It's very important to break any challenge down mentally. Don't think about the race in its entirety, but rather divide it into small, bite-size stages. It could be getting to a swim buoy, passing an aid station on the bike or seeing family and friends on the sidelines on the run. You can even use other athletes as target practice if you want to! But try not to think too far ahead. Simply think about what is happening to you and your body at that moment in time.
Especially when you cross the finish line.