I've said it before and I'll say it again: much of what causes unhappiness is related to our perception of a given situation, as well as our unrealistic expectations.
If we inherently expect that life is challenging, has "thorns", then the "roses" will all be pleasant surprises and easier to express our gratitude for.
I'm not saying we should walk around being pessimistic. But, as it turns out, no matter how hard we try to live life by all the rules, things still happen that are beyond our control. Logically, we know this. Yet, when something unexpected and bad happens, we are still surprised, even incredulous. It throws us for a loop. Stalls us.
Our perception of the situation will likely determine how long we remain stalled, emotionally, at least.
I propose the next time something bad or undesirable happens, we take a deep breath, face it, do what we can to minimize the damage, accept what is beyond our control, and move on as best we can under the circumstances. It may not live up to our expectations. But on the other hand, in the end, it may exceed them.