Lots of excellent advice here but this I just had to comment on. It is SO EASY to teach them to be the exact opposite of what you really want by continuing to expect them to do the thing you don't want them to do. You have to always try to EXPECT them to do what you really want. This is different from expecting them NOT to do X, Y, or Z. Putting your focus on the desirable behavior - even if the complete reverse is actually occurring in the moment - will make it clear to them. Focusing on what you don't want will make them think that is what you do want, because that is what you're thinking about. Horses don't do pretend or tricks like people and predator animals do so they have no chance of understanding you if you're focused on the wrong thing. Then, allow them the time and space to figure it out. Some horses need more time than others.
Edited to add: I was at a clinic once. There was a young girl there with a super cute Fjord who regularly bucked her off at the canter. The clinician had her ride the horse and sure enough, about halfway around the ring the first time she cantered, the pony gave one buck and the girl rolled off. The pony looked like he knew he just did what he was supposed to, I mean he almost looked proud. Stopped and waited until she got back on, I think he honestly thought this was part of the normal ride. Just an example of how these miscommunications can end up! The clinician made exactly this point, the girl was expecting her pony to buck her off and he faithfully did it, and really just about as gently as he possibly could.