So, first order of code-business is to build out a Cat and it's State Machine. If you've coded before, you should know what an If Statement is. "If [this] is true, make [that] happen"
You will also know that stacking if statements quickly becomes an evil tangled mess. Never fear - this is where we build a State Machine to categorise ideas so they don't get messy and don't overlap.
With Godot, what we'll do is use it's Node system to break up our code into chunks for what our cat is doing. First we build a cat (once "scene)", attach a Animated Sprite2D to give it a picture, throw in a Collider and then throw in our State Machine and some nodes for each interaction. Tidy!

When we make our code, we'll staple the relevant scripts to each node to keep it clean. This isn't fully necessary, but it makes it easy to work with.
We then give our state machine some code to tell it how to think about it's children-nodes and a template for how to think about it's States (I'll be real, I'm so new to Godot I used the tutorial here).
I'll avoid explaining it all (as the tutorial above goes over most of it - go give them views!), but we can use this to have our Cat do things.
The code below is for wandering about, but it will randomly take a nap and if the cursor gets near, it'll follow the cursor.
Not pictured: me trouble shooting the cat floating into space when the cursor hovered above it, and the cat vibrating instead of sleeping.