After recently revealing that she suffered from severe depression after finding out she needed a second kidney transplant in 2017, Sarah Hyland is opening up even more about overcoming her darkest moments during her ongoing health battles.

In an appearance on The Ellen DeGeneres Show on Friday, January 11, Hyland said she often had suicidal thoughts following years of health problems and surgeries. “I would write letters in my head to loved ones — why I did it, my reasoning behind it, how it’s nobody’s fault,” she said, describing herself as having been “very, very, very close” to taking her own life. “I didn’t want to write it down on paper because I didn’t want anyone to find it. … I didn’t want anyone to know I was that close, because if they knew, they would try to persuade me.”

Hyland said she eventually told a friend how bad her depression had gotten, and just verbalizing it helped her to realize that, even though she had what she calls an “amazing support system” on the set of Modern Family and in her own family, she needed to seek professional help from a therapist.

“Every person with their anxiety, or depression, or suicidal thoughts, every individual is different,” she told DeGeneres. “So I wouldn’t rely on everything I say, 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 puts everything in perspective.”

Hyland has suffered from kidney dysplasia and related illnesses her whole life. In December 2018, she revealed that she had received a second kidney transplant in September 2017, this time with a kidney donated by her little brother, after her body rejected the initial transplant donated by her father. The 28-year-old is currently in good health and hopes to help people in similar physical or mental health situations by talking about her struggles.

If you’re having suicidal thoughts, please call the National Suicide Prevention Lifeline at 1-800-273-8255, or text the Crisis Text Line at 741-741.

(photos via Michael Rozman/Warner Bros. + Gabriel Olsen/Getty Images)