In the darkest moments of her depressive episode, Dr. Carol Pak-Teng lay in bed for hours, struggling to summon up the energy to work another 12-hour shift in the emergency room.

“There were moments where I thought, ‘If I just melted away into this bed, that wouldn’t be so bad,’ ” the 34-year-old recalls of that time in 2015. About a year later, another resident at the Manhattan hospital where Pak-Teng worked — whom she declines to name — died after jumping off its roof.

“The other residents weren’t even that shocked,” she tells The Post, “because so many of us have had that thought.”

There’s a dangerous epidemic among medical professionals: Forty-four percent of all doctors surveyed in a 2019 Medscape report said that they feel long-term, unresolvable job stress, detachment and burnout from their work. What’s more, one US doctor a day ends their own life — the highest suicide rate of any profession — and as many as 30 percent of medical students and residents have depressive symptoms, according to the American Psychiatric Association. The dire mental-health crisis doesn’t just stem from life-or-death decision making, but from the exhausting amount of work involving computerized medical records that bog down their already long days, compromising the quality of care for patients.

The problem is a national one, but New York City is a “hotbed” for doctor suicides, says Dr. Pamela Wible, an Oregon family-medicine practitioner who runs a suicide hotline for physicians. Wible says she fields more calls from New York City than anywhere else. Last year, a medical student and a resident at NYU medical school killed themselves within just five days of each other, following suicides by a medical student, a resident and a physician, all affiliated with Mount Sinai, between 2016 and 2018. (Representatives for NYU said they have no further comment; Mount Sinai did not immediately respond to requests.)

“These are humanitarian idealists,” Wible says. “Why would they be stepping off rooftops in the prime of their careers?”

The answer is a complicated one, says Dr. Kendra Campbell, a psychiatrist who worked in NYC hospitals for nearly 10 years. Here, she says, the hospitals are busier, the patients have a wider range of ailments and the staff can be downright mean — on top of the usual list of stressors in a doctor’s life.

Campbell — who says she was once set up to do the wrong procedure by a supervisor she had rejected romantically — worked as many as 100 hours a week. Much of that was spent logging electronic medical records.

‘There were moments where I thought, “If I just melted away into this bed, that wouldn’t be so bad.” ‘

“I can’t say I was 100 percent suicidal, but I certainly was close,” says Campbell, who lost two colleagues to suicide. She herself quit working in hospitals in 2017 to run a private practice in Virginia that specializes in video-based consultations with health-care professionals. Many of her calls, she says, come from New York City.

Outside of the city, conditions aren’t much better. As a medical student in 2014 near Buffalo, Dr. Hawkins Mecham found himself working nearly 100 hours a week. He barely had time to mentally process the deaths of his patients, and he found his supervisors emotionally abusive, as though his training was a “boot camp.” Not surprisingly, his marriage was also starting to crumble.

“And then I just snapped,” the 33-year-old says.

Mecham slit his wrists in a motel room, losing so much blood he passed out. When he woke up on the bathroom floor, he thought, “What in the world did I do?” before bandaging himself up and driving to the ER, he says.

Although he entered treatment, the depression remained with him throughout his residency, he says. The second time he experienced suicidal thoughts, he told his residency program director, who helped him take time off and followed up to make sure he was eating and sleeping.

Mecham, who now works in Utah as a physician and teacher, doesn’t believe his patient care was impacted by his depressive state. But doctors such as Campbell believe that a doctor’s health can affect patients.

“Of course it affects patient care,” she says, recalling days when she was sleep-deprived, stressed and burned out. “I remember standing there feeling dizzy with a needle in my hand, thinking, ‘This can’t be good.’ ”

Even the early stages of burnout can impact care, says Dr. Ashish Jha, director of the Harvard Global Health Institute and author of the 2018 report “A Crisis in Health Care: A Call to Action on Physician Burnout.”

“Imagine going to see your doctor and he or she feels emotionally exhausted and disconnected, to the point where it’s hard for them to listen effectively or be empathetic,” Jha says. “Most physicians will work hard to counter that. But ultimately . . . burnout harms patients as well as doctors.”

Yet some doctors are afraid to seek help. Pak-Teng — who in 2016 started working at a hospital in New Jersey where her schedule is lighter, and is an advocate for doctors’ mental health — was told to be discreet: Getting professional help meant she was confessing weakness, she was told, and could adversely affect her career.

Jha adds that current electronic health-record software needs significant improvements, and that developers of those improvements should work with doctors so that changes don’t make the burden worse.

“I always jokingly tell patients who see me looking at my screen more than them, ‘Welp, I’m just a well-trained monkey that clicks buttons,’ ” Mecham says of the computer work. “I spent hundreds of thousands of dollars on my education, and I’m reduced to clicking buttons and staring at computer screens for hours on end.”

Jha also suggests that every hospital appoint a “chief wellness officer” to intervene and prevent burnout. Mount Sinai appointed one last May.

Wible agrees that hospital administrators need to do more to help doctors. For one thing, she believes the phrase “burnout” should be banished from the conversation.

“If you say you’re burned out, it just means you’re working too hard, versus being depressed or suicidal, which is often the case,” she says. “It’s like having the wrong diagnosis — you’re unlikely to solve the epidemic if you don’t really have the right word.”

And doctors still believe there’s not a lot being done to address the lack of mental-health services and the long hours and depression they experience, aside from well-intentioned but ultimately useless “wellness” programs.

“They just say, ‘You should do some meditation or yoga,’ ” says one doctor, who struggles with suicidal thoughts and declined to be named out of fear it would jeopardize his medical certification. “But you can’t ‘yoga away’ stress.”

Mecham says doctors’ best hope might come from their colleagues. He tells his medical students the same thing his own therapist told him in the days after his suicide attempt.

“What would you tell a patient who had the symptoms you have?” he says. “You would most likely say, ‘You need to make time to get help.’ Because if we don’t care for ourselves, it’s only going to get worse.”

If you or a loved one is suffering, call a suicide-prevention hotline, such as the National Suicide Prevention Lifeline, at 800-273-TALK