Meilin Keen is free of cancer. She doesn’t feel that way.

Keen, 28 years old, was diagnosed with gastric cancer last year and a surgeon removed her stomach in December. Her stitches have healed and her appetite improved. But moving on with the rest of her life has proved tougher than she anticipated.

Side effects, including fatigue, followed Keen when she returned to work and resumed her studies for the New York bar exam Money was tight and she felt anxious. One day she considered ending the life she had worked so hard to build.

“I don’t really know when the good and the bad days are going to be,” Keen said.

More people than ever are living after cancer . Some 18 million in the U.S. have survived the disease, and their ranks are expected to grow to 26 million by 2040. Among the people under 50 getting cancer in rising numbers, survivors will have decades of life ahead of them.

“We are facing a survivor tsunami that we are not ready for,” said Karen Knudsen , an executive at the American Cancer Society.

The treatments that save people’s lives can impart side effects including heart and memory problems that linger or emerge years later. Each new pain or scan could herald cancer’s return. People who had cancer in childhood age faster and die earlier than cancer-free peers.

After Scott Capozza finished treatment for testicular cancer in 1999, the then 23-year old eagerly returned to graduate school and barhopping with friends. “I wanted to just compartmentalize it,” he said.

But he soon found himself telling dates he had banked his sperm before chemotherapy that left him infertile. He always waited until after their first meeting, afraid of scaring them off. After a friend’s father died from cancer, he felt guilty for surviving.

A decade later, lung damage from the chemotherapy forced the avid marathoner to stop running. When everyone started wearing masks during the pandemic, he could no longer get away with reading lips to compensate for the hearing loss the chemotherapy imparted as well.

“Your hair grows back, and we can cover up our scars with our clothing. You don’t really know what’s going on on the inside ,” said Capozza, now a 48-year-old father of three, who works as a physical therapist at the Yale Cancer Center survivorship clinic.

As U.S. cancer death rates have declined, doctors have lowered the intensity of some therapies to spare patients from future complications. They are also learning how to manage new side effects from newer drugs. Dr. Alexa Meara , a rheumatologist at Ohio State University, is treating more rashes, heart and liver inflammation and arthritis from drugs that turn the immune system against cancer .

“Your body is never the same,” Meara said.

Keen was studying for the bar exam when she started throwing up blood in June 2023. She was diagnosed with gastric cancer . Keen postponed the bar exam. Her treatment sped from tests to chemotherapy to surgery that stitched her esophagus to her small intestine.

Doctors declared Keen cancer-free in December. But brain fog and fatigue made working full time and studying for the bar untenable. She left her job in April. Seemingly random foods including carrots and rice made her vomit. She distanced herself from cancer-support groups, no longer identifying with patients in treatment.

Keen’s anxiety mounted as she retreated into a Manhattan apartment that was getting harder to afford She was too stressed to eat almost anything in the week before she took the bar exam in July . She started looking for a job. She called her parents and friends in tears.

A Polaroid taken last year in the middle of Keen’s diagnosis shows her friend cutting her hair. Photo: Sarah Blesener/WSJ

“My apartment is, like, stained with cancer and bar prep,” she said.

One night in August, Keen sent an email about a job application and immediately regretted how she had worded it. More than a year of stress and grief came down on her at once. She wanted relief, and thought about ending her life.

“I actually had a complete mental breakdown,” she said.

Keen messaged her psychiatrist, who gave her a number to call in a medical emergency. Keen called, and two policemen arrived at her apartment door. Keen went with them to the lobby and answered questions in an ambulance. She felt embarrassed and declined to go to a hospital.

A week later, a law firm offered Keen a job.

She moved in September into a less-expensive apartment in Jersey City with a dishwasher and a balcony. Light shines through the windows. She started her new job working on insurance cases. She is eating carrots, rice and even pizza, which used to upset the stomach she no longer has.

“I’m just trying to be patient and kind to myself,” she said.

Her bar-exam results arrived by email one morning in October. She had to read the first line repeatedly to believe it. She passed.

Keen jumped around her room, squealing. She blasted the good news to her parents and friends. At work later, colleagues asked why she wasn’t out celebrating.

“This uphill battle that I’ve been fighting for the past year, it’s finally plateaued a little,” Keen said. Her next scan to check for signs of cancer is in November.

A few days after Keen got her exam results, friends from law school came to her apartment with mini cupcakes. They blew out candles, and each of them made a wish. Keen kept hers a secret: “I’m not spoiling it.”

Help is available: Reach the 988 Suicide & Crisis Lifeline (formerly known as the National Suicide Prevention Lifeline) by dialing or texting 988.

Write to Brianna Abbott at brianna.abbott@wsj.com