I am generally a very positive person but it takes work. It is easy to stay positive when everything is going well but when things go bad is a different story.
One technique I use is to consider everything a learning experience. When something goes bad and I start to get upset I ask myself “what did I learn from this?”.
Not only do I learn from the situation but it pulls me out of the emotional side of things, and turns on my thinking brain which allows me to see the situation from the outside.