One of the biggest challenges in life is learning to appreciate its obstacles. Everything - from missing a bus to being fired or jilted can be made better by holding this viewpoint.
People like to have control of what happens so much that a new direction, even a much better one, is often overlooked. Every problem allows a moment to decide to do things differently, to change course.
No one gets a "perfect" life where nothing potentially negative happens. If they did these would probably be the most boring, dull people you would ever meet. Change is not always easy, but it is infinitely easier knowing that there is almost always a gift from it waiting to be opened.