To be mentally tough is to resist the urge to give up in the face of failure, to maintain focus and determination in pursuit of one’s goals, and to emerge from adversity even stronger than before. Psychologists claim that almost everyone can benefit from strengthening these skills, even those people we might consider paragons of mental toughness: army drill sergeants. The U.S. military is now implementing a resilience-building program, designed by a team of researchers at the University of Pennsylvania, intended to make soldiers as rugged in mind as they are in body. This effort—one of the largest psychological interventions ever attempted—holds lessons for anyone who wants to strengthen their mental muscles.

Drill sergeants were chosen to receive the training because they’re in a position to teach the service members under their command, promoting a trickle down of psychological resilience. The program’s key message: Mental toughness comes from thinking like an optimist. “People who don’t give up have a habit of interpreting setbacks as temporary, local and changeable,” notes Penn psychology professor Martin Seligman, describing the intervention in a recent journal article. When such individuals encounter adversity, they think to themselves: “It’s going away quickly; it’s just this one situation, and I can do something about it.” Sergeants learn to analyze their beliefs and emotions about failure, and to avoid describing failure as permanent, pervasive and out of their control — all characterizations that undermine mental toughness.

Another pillar of psychological fortitude is the ability to resist “catastrophic thinking” — the tendency to assume the worst. Seligman’s program offers examples drawn from army life: a sergeant stationed abroad doesn’t hear from his wife back home and concludes that she’s left him; a sergeant receives a negative performance evaluation from his commending officer and immediately thinks, “I won’t be recommended for promotion, and I don’t have what it takes to stay in the army.” Participants learn to fight back against such negative thoughts, challenging their accuracy and searching for a more positive spin — while also making sure to reflect and act on genuine concerns and problems.

Lastly, the drill sergeants in Seligman’s program are taught two capacities that might seem at odds with mental toughness: gratitude and generosity. Participants learn how to “hunt for the good stuff” — to look for and appreciate the ways in which they are fortunate. And they learn not to judge too hastily subordinates who themselves seem to lack grit. The participants are offered this scenario: “A soldier in your unit struggles to keep up during physical training and is dragging the rest of the day. His uniform looks sloppy and he makes a couple of mistakes during artillery practice. You think to yourself, ‘He’s a soup sandwich! He doesn’t have the stuff of a soldier.'” The sergeants are warned against over-generalizing about others based on a few pieces of information, and encouraged to cultivate strength in junior soldiers instead of rejecting those who don’t make the grade right away.

Similar interventions with civilians have succeeded in reducing participants’ vulnerability to anxiety and depression. While evidence of the program’s effectiveness for soldiers heading into combat is still being gathered, it is hoped that enhancing resilience will help reduce the incidence of post-traumatic stress disorder and suicide among service members and veterans, which has soared to record levels during the United States’ military engagement with Iraq and Afghanistan. The 10-day training session, which also focuses on building personal strengths and fostering positive relationships, can’t address every psychological issue that soldiers may face. But sergeants who graduate from the program return to drill practice with a new kind of ammunition: a keen understanding of how to toughen the mind for the daily battle against adversity.