My answer is three-fold: First, I think of how things could be infinitely worse. Second, I think of a solution to the problem and if one is possible at all. Third, I think of all the positive things that have happened and about my loved ones and try to focus on them. I'm not saying that I am always able to do the third step and maintain focus but I at least try.
The name of God and the realization of how much I love my family and how I get angry at them for small reasons....in short, I realize how lucky I am and that kind of uplifts my mood which helps me sort out my problems.