To "obey" means to do what your master says. We most often use "obey" when talking about pets:
You can teach a dog to obey your commands, but it's hard to train a cat.
Sometimes people use "obey" to talk about people, but it can sound kind of insulting. It makes the person who's obeying seem like an animal or slave.
When she tells him to do something, he obeys like a servant.
There are three ways to use "obey":
I will obey.
He obeys his master.
They obey my commands.