When people fail at work, your instinct may be to go into problem-solving mode. You search out reasons for the failure, try to figure out how to avoid it in the future, and draw out the lessons to be learned. But when people who have failed are in the depths of despair, they need empathy more than your rationalizations and encouragements about the future. A concerned response is not only compassionate but productive. Empathy communicates trust, and people perform best when they feel trusted. Next time one of your people falls short, listen. Don't interrupt, don't offer advice, don't say that it will be all right. Just reflect back what you hear them say. There will be time to solve the problem later.
Source: "The Right Way to Respond to Failure" by Peter Bregman