Sad and alone

Im really sad atm. I feel like i could slip back into my depression. I just recently hooked up with an ex bc he made me feel like we were gonna get back together, but a few days later my friends all told me how he finally made things official with his now gf and now i feel like shit. Like ik its not my fault, but i feel like a homewrecker. And i havent stopped crying bc we fucked without a condom, bc my dumbass thought we were gonna be together like the old times. And now im here crying nonstop just thinking about how fucked up this situation is. Any advice on how to get over him? Or what i can do?