If your event goes completely smoothly with no problems you are indeed lucky; most people's success in long distance events is due to their ability to cope when things go wrong. We like to use Prof Steven Peters' strategy AMP as a psychological coping mechanism when things go wrong.
A is for Accept
When things go wrong we are going to get upset; this is normal. Accepting that you are going to be upset, having a bit of a tantrum or a cry can help; it's your brain's way of processing what is happening and allowing yourself some time to be upset will help you get to the next step.
Acceptance is also about accepting the situation as it is, wishing it were different is a waste of your energy and time.
So have a cry (or a rant) and accept that this is the situation you are in.
You can't sit and cry at the side of the road forever so you will need to move on. Moving on is about starting to think productively about how you are going to get out of the fix you are in and then taking action.
You will have far more success at moving on and reduce the risk of a repeat incident if you have a plan. It will also give you focus. Good planning is about
You can check out this and other great psychological tools in Prof Steven Peters books, 'A Path Through the Jungle' and 'The Chimp Paradox.' Chimp Management also have some great resources you can use in training, racing and life.