I don't want my friend to kill himself

My friend has been struggling for years and he's a christian but not a very religious person. However I can't help but sympathise with his struggles... he's genuinely going through hell as both his parents are abusive and he's left with no financial support.

However this is the part where I hope I did something right... he's gay and I genuinely want him to be happy. Unfortunately he wants to kill himself for being this way and I convinced him to live and told him that I'd rather he be gay, happy, and sober rather than being miserable and ending up killing himself. Please tell me I didn't something wrong. If I told him at the moment of the sin of being gay he'd honestly off himself so I think saving him is better than him harming himself