I can relate to this because I struggled with depression on and off since I was 10 and thought about suicide A LOT. I even went so far as to read testimonies written by people who've been revived after being declared clinically dead in an effort to find out what really happens to us after we die. It's also why I don't own any guns... I'm too afraid I'd use one on myself if I was having a bad day.
For those of us with an ASD and depression, it's a double whammy because if we get into an adverse life situation, often we can't see a way out. What worked for me was to address the root cause of my depression... in my case, it was being surrounded by unsympathetic people who only wanted to use me to their own advantage. They were toxic, and my job was toxic... maybe many of us on the ASD aren't comfortable with change, but in my case, change was a carrot and not a stick, as long as I stayed focused on my quality of life and how I could improve it.
Turns out I'm ready to settle into not one but 2 new jobs, both of them as my own boss and both of them commensurate with skills that come naturally to me... so yeah, the key is to figure out what's toxic to you and put it out of your life.