First, don’t feed the horse anything out of your hand. If you want to give him carrots, break them up and put them in the feed bin when he’s not looking–for instance, when he’s in the wash stall. Don’t let him see you carrying around yummy things and maybe, in time, he’ll stop searching you with his mouth.
Secondly, devise a punishment for his biting that won’t make him head shy. You could slap the horse on the shoulder; but don’t slap the animal anywhere on its face, for this invariably causes a horse to be head shy.
Third, keep a salt-mineral block (and lots of water) in the horse’s stall. An animal that is deficient in minerals will sometimes be prone to chew on things.
Finally, make sure your horse has as much turn-out time as possible. If an animal becomes bored in the stall, it will often crib, bite at passing humans or horses, or develop other bad habits. All horses mentally benefit by spending time in their natural state, leisurely grazing.