Practice race turns, finishing fast, getting your pain to work for you, etc. The more important you can make your practices and the more similar to actual meets, the more you'll get out of them. If you consistently practice this way, the way champions do, you 11 soon find your meet times dropping. Swimmers who get distracted with this kind of future focus almost always swim tight and feel heavy. Stay in the now as you race concentrating on what you are doing, while you are doing it.
Concentration is the key mental skill to swimming excellence and mental toughness.
Quickly and gently bring yourself back to a proper focus. This is the heart of championship concentration. Champions do one thing better than everyone else. But just as important, they let it go quickly. In other words, they don't dwell on the past.