When something happens that I don't like, when I feel crappy or angry, I stop and deliberately think, "Why do I feel this way? Why am I doing this?"
I ask "why" and "why" and "why" of myself multiple times until I get down the real reasons.
Why do I do this?
Because I was unhappy and I didn't want to be. I have a perfectly great life and yet I was unhappy. I decided there was a way to be happy, no matter what my situation was.