Jan. 11 (UPI) -- Sarah Hyland was "very close" to suicide as she struggled with health issues over the past few years.
"At the time, I was 26, and after 26, 27 years of always being sick and being in chronic pain every single day and you don't know when you're going to have the next good day, it's really, really hard," Hyland told host Ellen DeGeneres.
"I would write letters in my head to loved ones -- of why I did it, my reasoning behind it, how it's nobody's fault," she said of her suicidal thoughts. "And I didn't want to write it down on paper because I didn't want anyone to find it."
The Modern Family star has undergone two kidney transplants and 16 surgeries during her lifetime. She was "very, very, very, very close" to ending her own life when she finally shared her feelings with someone else.
"It ended up being myself that got me out of that," the star said. "I had to do it on my own. I told myself I had to do it on my own."
"I finally said it out loud to someone," she recalled. "Just saying it out loud helped immensely because I kept it to myself for months and months at a time."
Hyland previously told Self magazine she contemplated suicide after her first kidney transplant, which came from her dad, failed.
"I was very depressed," she said. "When a family member gives you a second chance at life, and it fails, it almost feels like it's your fault. It's not. But it does."