When you want your cat to behave in a sane, reasonable manner it is only right to teach it good behavior, and to give it the kind of conditions that allow it to feel loved and give love in return – this way, it is a lot less likely to react to things in a hostile manner.
However, you do have to pick your moment with a cat, because trying to get the best response depends inherently on having the best conditions in which to train.
For one thing, it is a very bad idea to try to train a cat which has until very recently been sleeping. Picking a cat up from its basket or its favorite spot in order to train it is unlikely to get you good results.
You’ll be trying to get the cat to understand commands and respond to them in the right way, and it will merely be looking back to the warm spot it has just vacated through no choice of its own and hoping very much that it can go back soon, please.
Training a cat when it has just eaten is also something that should be avoided as far as possible. You are less likely to get a good response from a cat who sees no real reason to co-operate.
If there is just the edge of hunger a cat will be more attentive, very much in the hope that it will get some food, but if it has just eaten then all it will want to do is curl up and have a nap.