When something bad happens, there’s a period during which your emotions take over. They momentarily overshadow logic and reason as your body reacts to the situation. During this time you don’t think clearly. You don’t choose the best course of action because you are too busy reacting instinctively based on your emotions. Your judgement is clouded.
This initial period of emotional reaction is necessary but not useful. While you are in it, you cannot fix the situation or make any progress forward. It is pure stagnation.
After that period of time passes, your emotions die down as logic and reason come back into play. You regain the ability to actively resolve the situation and make progress forward. This second phase is useful.
You cannot avoid the initial emotional reaction. It is part of being human. But you can decide how long it lasts.
Understand that it happens and that it is a necessary result of a bad situation. Your body needs to react. Let it. Then, step back into the driver’s seat. It can happen in a matter of minutes if you want it to.