By Samantha Puc

Although Modern Family star Sarah Hyland may appear to have a perfect life on the surface — great job, great boyfriend — she has had many serious illnesses throughout her life, which at one point led her to have suicidal thoughts. During her appearance on Friday’s The Ellen DeGeneres ShowHyland opened up about her struggles with depression and encouraged those with similar struggles to seek help when they’re in that dark place.

Hyland described having “about six surgeries over the past couple years, but I want to say maybe 16 surgeries altogether throughout my life — I just turned 28. I’ve had two kidney transplants, I have endometriosis, a whole slew of things.” She told host Ellen DeGeneres, “At the time I was 26, but after 26-27 years of just 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.”

She said suicidal thoughts led her to “write letters in my head to loved ones of why I did it and my reasoning behind it, how it was nobody’s fault. I didn’t want to write it down on paper because I didn’t want anybody to find it. That’s how serious I was.” She described herself as “very, very, very close” to taking her own life.

What pulled her out of that space, ultimately, was saying it out loud to a friend and admitting she wanted to seek therapy to help her do some serious soul-searching. Hyland explained, “It ended up being myself that got me out of that. I had to do it on my own. I told myself I had to do it on my own.” She admitted, “I didn’t want anybody to know that I was that close, because if they knew they would try to persuade me.”

Credit: Instagram

However, Hyland also noted that everyone is different and that mental health shouldn’t be treated the same in any case. “Every person with their anxiety or depression or if you have suicidal thoughts, every individual is different, so I wouldn’t just rely on everything that I say,” she said. “I’m just sharing my story. But I think talking to someone and saying it out loud really, really makes it sound almost ridiculous and it puts it into perspective.”

This isn’t the first time Hyland has been candid about her struggles with physical and mental health. She frequently talks about these subjects on her Instagram, and she did an interview with Self magazine in December about receiving two kidney transplants, undergoing dialysis and dealing with chronic illness.

These days, her boyfriend, Wells Adams, is a big part of her support system; she told DeGeneres on Friday that the pair went on their first date just days before she was set to receive a kidney transplant. Although at the time, she thought he flew to Los Angeles just to go out with her after she told him he had to visit before the week was out or their romance would never take off, she later found out he had a work trip scheduled anyway.

“I found out like a few months into our relationship that it was really just a coincidence and he didn’t fly to L.A. just for me,” she quipped. “It was just a convenience.”

Originally published on SheKnows.

Follow us here and subscribe here for all the latest news on how you can keep Thriving.

Stay up to date or catch-up on all our podcasts with Arianna Huffington here