Cats are sensitive creatures, and physical punishment can cause them fear, anxiety, and pain. It can also damage your relationship with your cat and make it difficult to train them.
Instead of resorting to physical punishment, try positive reinforcement methods to train your cat. Reward good behavior with treats, praise, and play. If your cat is misbehaving, redirect their attention or remove them from the situation.
If you are having difficulty managing your cat's behavior, consult with a veterinarian or a certified animal behaviorist for professional advice.