First you need to Realise. If it has happened then saying it shouldn't have happened can't be true. It happened and in the mechanisms of the universe if it happened it's because everything was set up to make it happen.
What takes away our happiness is is our thinking. That something that did happen shouldn't have happened. It throws us into powerless thinking.
If you want to get back to good feelings, feel empowered and happy you need to first accept what happened, happened. (I know it's difficult in many situations.) But it's a case of, Okay it happened, where to from here? What can I do to make the best of the situation. What needs to be done to get ahead. What questions should I be asking myself that move me forward. What action can I take?
It comes down to asking questions that move you forward. Avoid questions like who's to blame, How do I make them pay, why are idiots like that around, why was I so stupid. They don't move you ahead. They continue to keep you stuck.