I use a collection of approach and retreat techniques, tailoring a bit exactly what I do to the exact problem that the horse has with the trailer (big trick: knowing what the horse's problem is. Is he afraid? Or is he essentially flipping you the bird and saying "I don't wanna?").
First and foremost, I want the horse to be respectful in-hand in general. At the very least, I want him to willingly lead forward at the walk and trot, halt from the walk and trot, back up, and yield his shoulders and haunches, all off of body language, with no dragging or pulling. Ideally, I'd love it if the horse could do all of the above without a halter and lead as a safety net. When the rubber meets the road, trailer loading problems are fundamentally groundwork/leading problems. Exposure to things like trail patterns in-hand can be great prep, too. You essentially want the horse to say "Yes'm/Yessir" to any request you make. Start with an established pattern of respect.
Next, make sure that your trailer is as inviting as possible -- I like a trailer with a bright interior, but I've used several that were painted dark reds and burgundies inside without any problems that I'd blame on the decor.
Set yourself and the horse up for success -- line up straight, and approach the trailer with confidence and purpose. That horse is going to step right on without breaking gait. Know that, expect it. If he doesn't, it's going to be a surprise. Don't look at him, just walk purposefully aboard the trailer. Nine times out of ten, if the horse is not afraid and is respectful in general, confidence in the leader is what's lacking.
I want the horse's attention on the trailer -- even if he halts in his tracks, scared out of his mind, I want him thinking about the trailer. Reward the smallest change and the slightest try to come closer (applies to fear and defiance -- a step forward is a step forward). If his mind wanders, or he chooses to go away from the trailer, I let him... for about 3 steps. Then I take his idea as my own, and we do some work. It can be anything; circling, backing up, whatever, as long as the horse is moving his feet according to your direction. Look for those signals of attention: an ear on you, relaxed posture, soft/blinking eye, licking/chewing, etc. When you judge the horse to be relaxed and focused and thinking about you, reapproach the trailer again, and if he doesn't step aboard (like you wholly expect him to), let him hang out as long as he's investigating it and thinking about coming further in. Rinse and repeat. The difference between the fearful horse and the defiant horse is how much pushing you want to do, and how you want to do it. A truly fearful horse, I will try to wait out its natural curiosity -- that will eventually take over. Some gentle encouragement forward may help. A defiant horse may take a well-placed and well-timed spank to come forward. It all depends on the individual horse, what his issues are, and what will best help him to learn and understand either that the trailer is not a death-wagon, or that you are a leader worthy of respect who is telling him to step up.
Make the right thing easy and the wrong thing hard -- the trailer is a place where the horse gets to rest (whether he's thinking seriously about it or actually coming closer/loaded), and the area outside the trailer is a place where he has to go work if he chooses to be out there (or thinking seriously about going there). Give yourself all the time in the world -- you don't want to have to drop the lesson at a bad spot because you're running out of daylight or are late to a dentist appointment. Check your emotions at the door. Trailer loading can get frustrating, for the horse as well as you. A person acting on their frustrations is not an effective trainer.
I get on with mine; I have a slant-load H&S stock trailer, not a straight load. A straight load is close enough quarters that I would want to send the horse aboard by himself and raise the butt-bar after him. I don't like rewarding with food for this. Never say never -- sometimes the best cure for an extreme fear of the trailer is to make it into a food-wagon. If I'm under a time constraint (need to move the horse NOW, no time for subtlety or real training) I might use some grain to lure the horse on just to get the job done once. BUT, the horse doesn't learn anything about me from being lured onto the trailer. If I need to use grain on a horse, that tells me that I need to spend some unconstrained time properly working out the issue with groundwork and psychology.
Sorry for the novel... hope that's helpful to you. I'm a groundwork/trailer loading geek, lol