Appreciate bad experiences – even if you would prefer that something didn't happen – it really doesn't matter. Instead, look directly at the thing that happened and ask if the situation taught you something positive and adjust your strategies accordingly.
This also applies while going through a bad experience. View it as a challenge, not as an obstacle. Ask yourself, "what are the opportunities for growth right now?” 1
1
Dweck, C.S. (2006). Mindset: the New Psychology of Success. New York: Random House.