Thank you for making that post, it is not an easy thing to do, but hopefully can be the start of something better. Thinking you have no friends, no future and no path forwards are very familiar to me, as is lack of confidence, not wishing to be a burden and wakeful nights with the mind going over and over all possible bad endings to whatever you think of.
While there are some things you can do to make yourself have a better life (I'll mention them in a minute) I suspect, as in my case, competent medical help is needed, with therapy and medication. It took me a long time, but now my life has turned around - something I'd no have believed possible.
So may I ask if you have proper medical support at the moment? If you do then you need to go back and say the current treatment is not working. If you are not under the care of a doctor now would be an excellent time to start - what do you think?
Apart from medical support is there anyone, family or friend, you can talk to about how you feel, someone who will just listen and care? It does make a real difference if there is such a person.
One of the things you can do is not judge yourself by everyday standards, if one is ill then things and capabilities change and to see yourself not performing as you think you should is terribly bad for your self-esteem - and not deserved. Even getting up of a morning can be seen as a victory.
I found that my life with exercise, nutrition and a special time to look forward to each day did make a difference too. I used books and movies, and really looked forward to the next few chapters in the evening. You talked of an escape, for me books did that, putting me in a different world.
What sort of things might do that for you?
Sleep hygiene is important and beyond Blue say a fair bit about it starting here
(This is not a live link, copy and paste in your browser)
I've also found the free smartphone app Smiling Mind of great benefit. It reduces stress and breaks my mind out of those continuous loops of worry. It does take some practice but can be very effective (you can switch the horrible background music off and there are enough prompts to keep even someone like me with a minute attention span on track).
You can talk here anytime Qwert1234, you are not alone.