It was a long, slow road, actually, and although I did the lion's share of training with her, I didn't do it all myself.
* Control her impulses
* Look to the handler for help and guidance
When I first got Fiddle, she seemed to be a very angry young horse. Although she was nearly 5 years old, she acted more like a cranky toddler than a nearly-mature mare, and she hated to be confronted with unfamiliar situations. She frequently tried to kick and bite people, she would plant her feet and refuse to walk properly on a leadline, and she pinned her ears at everyone.
Because she had learned elsewhere that she could scare some people by trying to bite them, we kept her away from timid people who might allow that behavior, and surrounded her with canny people who would get in her space and make her move her feet if she was inappropriate with her face. Every single time she tried to bite someone, that person (who was warned in advance what she might do and how they should respond) would crowd into her and make her yield her hindquarters, trot in circles, or back up--in other words, we were teaching her that "biting" equals "working".
We gave her the same response for her threats to kick. If she aimed a foot at someone, that person would work her. Eventually, she learned to keep all her feet under control when she was around people, because "kicking" meant "working."
The key at this point in her life was keep timid people away from her. This mare believes that if you give her an inch, she deserves to take a mile. If she ever succeeds with a threat to bite or kick, she would learn that sometimes she could get away with it. This is much harder to eradicate than the absolute you will always have to work if you try to bite.
I took her out in crowds whenever I could--to local poker rides, to playdays, and to trailheads that I knew would be crowded--and I enforced the requirement for good behavior while she was there.
When I find something that she feared (white plastic bags, for example), I incorporate that thing into her everyday environment, by hanging the scary thing on her fence, or having it poke out of my pocket. Her feed in camp comes wrapped in white plastic bags!