One fabulous technique we can use to help when a horse is doing something we dislike, is teaching them to do something else in it's place. Telling them not to do something can be difficult if we don't replace it with an appropriate alternative that meets the same need or achieves the same goal for the horse.
So anytime your horse does something you dislike, before going to punishment, stop and think "what would i prefer in this situation?" Or "how would i prefer they communicate this?" Then teach that behavior and cue it in the situation where that unwanted behavior appears. Show them more appropriate ways to communicate and have their needs met.