This is a really fast mindset changer. When things are not going to plan, or life seems very challenging, plant the seed of this question "what can I learn from this?" in your mind. It may not solve everything, and it won't necessarily eliminate the stresses coming at you, but it puts another path of thought in your head that can be an alternative to a negative spiral, and provides glimmers of hope and positivity to bring some balance to the situation.
Every situation we're in is an opportunity to learn something and grow. We may not have chosen to learn the lesson we're learning, but given that it's happening, the best we can do for both our emotional state in the moment, as well as our future growth, is to explore what life is teaching us.