Besides improving fitness, perhaps the easiest things you can do are to:
A) Smile when things start to get tough. The act of smiling can ease perceived effort and tension, and can provide you with just enough boost to get you though the difficult part of the race. A study (Psychology of Sport and Exercise) also found that smiling during a race can boost economy. Even if it doesn't help, smiling is not going to hurt your performance.
B) Come up with mantras you can tell yourself when it starts to hurt, or just things you can use throughout the race. It should be whatever motivates you or keeps you in control (for example, "smooth, strong, relaxed," or "I'm in control, will hang on and finish fast"). Again, studies demonstrate that mantras help. Most elites have mantras they use during races, often different mantras for different points in the race. (Say, lap one: "relaxed, steady smooth," lap two: "focus on the flow," lap three: "stay strong, embrace it, almost there" and lap four: "fast finish, fast finish, fast finish").
C) Set goals before the race. Like, an A, B, and C goal. The A goal might be to outkick the guy you want run with. The B goal might be a PR. The C goal might be a time you're happy with if conditions go to hell (the the race goes out too fast, the wind is nasty, etc.). Basically, the goals are there to keep you focused and in the race. If things go south you've still got something to focus on and strive for so you don't just completely pack it in if you're not going to achieve your A goal, or be able to hang with whoever you intend to run with.
D) Mentally prepare and visualize for what might happen during the race in advance. Brace for the suck and pain you're probably going to suffer on lap three. If it's a windy day, brace for the fact that you'll be running into the wind for half the race, etc. It's significantly easier for your brain to deal with crap during the race if you've already prepared for it mentally.
E) Be flexible. Have contingencies in place, and don't be consumed by the negative if things do go south. Maybe you fall off on lap three, but remind yourself that there's still a full lap to go and that anything can happen. You might get that second wind. You'll never know if you become all consumed with negative thoughts and give up.
F) Finally, watch inspiring race performances. There are a ton of videos on Youtube of guys that look completely out of races, only to come back and outkick everyone. Check out a clip of Sammy Wanjiru's 2010 Chicago Marathon for inspiration. He was completely out of that race and somehow managed to come back for the dead and will himself to victory.