Happiness and unhappiness (in work and in life) result entirely from the rules in your head that you use to evaluate events. Those rules determine what’s worth focusing on, and how you react to what you focus on.
Many people have rules that make it very difficult for them to happy and very easy for them to be miserable.
I once worked with a sales guy who was always angry at the people he worked with. The moment anything didn’t go the way he thought it should go, he’d be screaming in somebody’s face. He was making everyone around him miserable–but just as importantly, he was making himself miserable, because just about anything set him off.