Here are the most common scenarios. Under each, I've described a core workout that will help you race more efficiently in other words, faster.
To feel stronger from beginning to end, you need to complete longer runs.
Core workout: Go for a long run once a week. Lengthen the run by one mile each week until you reach 10 miles. Then add one mile every other week and race on the alternate weekends. Ideally, your long run should total at least one to two miles more than your race distance, but the marathon is another matter. If you completed 18 miles before your last marathon, run 20 this time. If you do 20 this time, try for 22 next time. During your long runs, keep your pace two minutes per mile slower than your 5K race pace. If you've never raced a 5K, go slowly enough so that you won't huff and puff during the last two to three miles of the long run.
You need to train your body to keep pushing the pace, even when you get tired.
Core workout: Do speedwork that consists of 400-meter repetitions. Start with four to six repeats and add one a week until you reach a maximum of eight to 10 repeats for the 5K, or 12 to 14 for the 10K or longer. Begin the workout at goal pace, gradually speeding up with each 400. Your last 400 should be considerably faster than your first.
The proper training can keep your mental and physical momentum going in the middle miles.
Core workout: Do 400-meter repeats. Start with four and progress to 12, completing the first third of your session a few seconds slower than goal pace. Do the 400s in the middle of the workout about five to seven seconds faster than goal pace. Run the end of the workout at or slightly slower than goal pace.