My horse had a similar problem with the trailer. He would load well because he was used to it but he was so nervous and my mom and i used to be terrified to unload him because he would get so up. I did a lot of loading and unloading just to practice not going anywhere. One thing I found helped was when I would get him ready to unload (Hooking the lead rope on etc.) I would do each piece of the process separately and then make him chill out before I went on to the next. So I would hook up the lead rope and when he would start to get all jazzed I would just stand there and ignore him essentially till he calmed down and started eating hay again. Sometimes i would stand just outside the door where he could see me still holding lead rope. The first few times took a long time but eventually he figured out if he didn’t calm down I wouldn’t take him off the trailer and get to go do fun things. I did the same thing with unhooking his head and with taking the bar in the back down.
Putting the bar down in the back and keeping him there takes a little muscle and persistence, that one was the hardest for my thoroughbred to overcome, when he would try to take a step or two back you have to pull him back again. Lastly I would make him stand on the ramp, show him its nothing to be nervous about just an incline to stand on. It only took a few times of working on this for my horse to really start getting this thoroughbreds are so smart and love to learn! Good Luck!