Whenever I hit a rut and start feeling sorry for myself, I try to think of how good I actually have it. I mean, who the fuck am I to complain about quality of life when, across the street from my office, is a medical facility that treats mentally retarded children.
I also try to ask myself if I had any control over what happened if it is a specific event that got me down. There is no point getting upset over things you can't control. Concentrate on what you can and work on being happy. It sounds ghey, but it works.