Sarah Hyland is open on her fight against depression by addressing a variety of health issues, including two kidney transplants.

The "Modern Family" actress spoke with Ellen Degeneres on Friday, where she said she was struggling with suicidal thoughts after "years of chronic illness."

"After 26/27 years of illness and chronic pain every day without you knowing when you'll have the right day, it's really very hard," Hyland told DeGeneres. "I was writing letters in my head to my loved ones to explain why I had done it and why I was not doing it.I did not want to write it on paper because I did not want someone to find it – it's how bad I was. "

Hyland, 28, said she was "very, very, very close" to committing suicide.

SARAH HYLAND REVEALS WHY HAD A SECOND KIDNEY TRANSPLANT

"It ended up being me who got out of this," said the actress. "I had to do it myself, and I thought I had to do it myself."

Hyland said that she had finally decided to ask for help after discussing her depression with a friend.

"I did not want anyone to know that I was as close as me because I knew they would try to persuade me."

The actress warned that while sharing her thoughts with friends was what had helped her get better, she did not want to speak for all people struggling with depression.

"Every person suffering from anxiety or depression or if you have suicidal thoughts, each person is different, so I do not just rely on everything I say," she noted. "I'm only sharing my story, but I think talking to someone and saying it out loud makes it almost ridiculous and puts it in perspective."

SARAH HYLAND, A STAR OF THE "MODERN FAMILY", ISSUES FEARS OF TRANSPLANTY IN KIDNEY IN BIKINI SELFIE

In December, Hyland revealed during a thorough interview with Self that she had undergone a second kidney transplant after receiving a kidney from her father in 2012. It had already been made public that she was suffering renal dysplasia, which essentially meant that his kidneys were not forming properly. when she was in the womb.

Hyland told the magazine that she did not know why the organ her father had offered her had not been taken properly.

"When a member of your family gives you a second chance in life and it fails, it's almost like it's your fault … and it's not. But that's the case, "she said. "We did all these tests and all these treatments to try to save the kidney, but they basically said that the kidney graft was like a house that caught fire, you can not burn a house."

CLICK HERE TO GET THE FOX NEWS APP

Fortunately, Hyland learned that his younger brother was a man apart and was willing to give him his kidney in a second attempt to remedy his poor health.