If ECT hadn't restored my mental health, I would probably have ended my existence to avoid further suffering. It is difficult to assess the level of suffering experienced by a person with severe depression. Insomnia, anxiety, significant weight loss, and feelings of absolute hopelessness are sufficient cause.
If I had understood, at age 17, the length of my torment in decades, and the severity of the symptoms I would somehow endure, I could easily have forgiven myself for abandoning life as I knew it. But, I took it one day at a time...and days turned to months, and months to years, and years to decades.
I never thought it could end as it has. I feel guilty that it is unlikely that other sufferers will be as fortunate as I was to learn the genesis of my illness and provide a self diagnosis that resulted in treatment that gave me my life back.
To answer the question as to whether family and friends would understand, the simple answer is no they will not. They will be hurt and they will suffer emotional pain. They probably feel helpless and inadequate in not being able to help you.
But, life will go on. You should understand this completely before you do anything final. Where there is life, there is hope.