Hell na, no lost cause, so many good replies here and trust me, most of these people including me are here for you. Maybe not the best place to find friends, but you do have friends here on terb!
Read books man, get to know yourself better, read your user manual, how your biology works, what kind of behaviours made you get stuck in those awful toxic relationships and what is it that you want in the future, nothing is off limits and age is just a number. We can achieve all we want, it may be different from what we have in our head, but we can still get it. We just need to look for it.
Regarding sex, we're men, nature wants us to fuck (how else is the plan of nature going to succeed?) and that's why we like it so much, sex drive will come back once you're feeling more happy and yourself. Don't be disappointed if your sex drive is lower now, fuck with only the good girls that make you feel good with lower rates for now. Work on yourself in the meantime.
It's all gonna be good. You're on the right path, you're already challenging your current status in life, that's the first step!