Even the most obedient pet sometimes has misfires.
However, this is not a reason to use force against your pet.
As practice shows, positive reinforcement has a much better effect on a dog than force.

How to Punish Your Pet Properly
Firstly, you should punish your dog only immediately after the misbehavior, otherwise after 20 minutes it will no longer connect your actions with its own.
Secondly, you shouldn't punish your dog if it still obeys you, even if not the first time. Sometimes it happens that your pet simply couldn't stop in time, for example, when it chased a cat.
Thirdly, after punishment there should be a reward in the form of affection or a treat: in contrast, the dog better understands why it is wrong.
Fourthly, be consistent in your actions: if you punish one offense once, subsequent similar cases should also receive an appropriate response from you.
And remember: punishment may not always be appropriate. If you have a puppy in front of you who simply has not yet figured out what is good and what is bad, you need to make allowance for his age and teach him with affection, otherwise the animal may become embittered.