TL;DR: can't get over my ex and feel dreadfully alone. don't know how to move forward.

We technically broke up in july. have been sleeping together on and off since, decided to give a relationship another shot about 2 weeks ago, that lasted a week before it fell apart. Tentatively started chatting again, have been friendly the week since (relationship lasted over 2 years so its still comfortable yknow) and then slept together again on saturday night. 

It was amazing. It was the best sex I'd had in a long time, it was loving and caring and didn't feel like a casual fuck at all.

Then his housewarming on tuesday happened, which I was invited to because of crossover friendship groups and us being friendly. I got drunk. Asked him to try again in a relationship and he said no. I was super upset, took all the clothes that were still at his place and sat on the porch until one of my friends could come with me in the uber home. Ended up in hospital that night after an overdose and heavy cutting. 

its 2 days later now and I can't stop thinking about him. I don't know what to do. I want him back more than anything. I don't know where to start moving on. I want desperately to message him but have been managing to restrain myself so far. 

In addition, I have no close friends left, no one to talk to, and feel like I've driven away everyone I was close to over the past 6 months with similar behaviour. How do I move forward? How do I stop feeling so lonely?