1. Reflect: If you constantly dwell on what should have happened, you will never accept what you need to change. It's likely that if you didn't go into your race injured, overtrained or without proper fitness, you are seeing your past race as a failure because "something" didn't go right. Well, think back as to what you thought was going to help you have a great race to see if there's something that you can change for next time.
Many times athletes will talk about specific sections during the race, nutrition, pacing etc. that was spot-on to the plan during the race. Once you identify these variables that you thought were well-practiced or "per the plan" put pieces together to see if there's something that you can tweak to help you have a better race performance. Maybe it's nutrition, pacing, heat acclimatization or skills or perhaps it's simple mental strength or the timing of your race. Whatever it is, be open to change and be sure to practice, practice, practice for next time.