Detach in a good way. Look at a situation from other PoVs. Is the frustration even warranted. A silly example, someone cuts you off in traffic. Some people go ballistic, but to what end? Shrug and move on. Think of it as don't let yourself bike-shed personal events. Focus on what matters.
if things aren't going your way, and you are ruminating and poisoning your blood fruitfullessly remembering the bad events, replace those thoughts with the acceptance that the events are there - stop agonizing uselessly, take the novelties as just a matter of fact. Get out of the thought, get out of the emotion - they can be replaced by a label, "Past. There. What is done is done. Next".
Then, if you can do something about it (to fix the situation), enter the constructive mood of the entrepreneur exploiting the useful fact of being alive to engineer reality. Otherwise, if you cannot do anything about it, bear the consequences but do not let the damage increase through an inadvisable behaviour of possibly letting events impact your mental, emotional states - that would be wasted energy, wasted health, wasted time.