Nobody does their best thinking while braced. Fear narrows what a person can consider; a decent mood widens it. That isn't a slogan — it's the ordinary experience of trying to solve anything at two in the morning versus after breakfast.
Which puts these two in exactly the order the sentence puts them. Waiting to be happy until the results come in postpones the very state that tends to produce better results.
It doesn't make cheerfulness a duty, and a hard stretch is not a failure of attitude.
It means the small things that steady you aren't a distraction from the work. They're part of the equipment.