Anecdotally, when I make bad decisions on the job it's almost always due to my emotional state. Whether it's the stress of an impending deadline, lack of sleep, feeling of inferiority, etc.
Even when I'm aware of a dangerous emotional state, it's difficult to make good decisions. Proactive prevention (get enough sleep, exercise, meditate if you're into that) has been the only solution for me. I'd be curious to hear more preventions and especially interventions that work for others.