Struggling with mental demons, Kayla Williams went to her bathroom and held a gun in her hand, contemplating suicide. It was 2004, and she’d been home for only a few months after serving as an Army sergeant and Arab linguist in the Iraq war.

But hers is one story that doesn’t end in tragedy: Ms. Williams held those demons at bay long enough to get help and learn to manage the challenges of marriage to a combat-wounded veteran while writing two books about her experiences. “I’m doing well,” she told me. She is now the director of the Military, Veterans and Society program at the Center for a New American Security.

Her journey, like that of so many others, has not been smooth. Recovery sometimes requires working with several therapists, changing providers when one isn’t working and undergoing repeated treatment. The government has begun to acknowledge the danger that suicide poses for an all-volunteer fighting force and has invested $1 billion in seeking solutions.

But that hasn’t proved to be enough. Suicide rates for active-duty service members and veterans are rising, in part, experts say , because a culture of toughness and self-sufficiency may discourage service members in distress from getting the assistance they need. In some cases, the military services discharge those who seek help, an even worse outcome.