Oftentimes, when I'm not in a good mood, I simply decide to be in a good mood, and soon I am in a good mood. It's surprisingly effective. You just have to consciously tell yourself that you decide to be in a good mood and try to be in a good mood. Of course this doesn't work all the time. I'm generally a happy person, so it's perhaps easier for me.
Of note: doing this does expend willpower, but I've found the more often I do it, the more "in a good mood" feels like my default state, and the less willpower it takes on average to get there.
Thus spake Eliezer:
It seems that many here might have outlandish ideas for ways of improving our lives. For instance, a recent post advocated installing really bright lights as a way to boost alertness and productivity. We should not adopt such hacks into our dogma until we're pretty sure they work; however, one way of knowing whether a crazy idea works is to try implementing it, and you may have more ideas than you're planning to implement.
So: please post all such lifehack ideas! Even if you haven't tried them, even if they seem unlikely to work. Post them separately, unless some other way would be more appropriate. If you've tried some idea and it hasn't worked, it would be useful to post that too.