Lots of great experience based advice here. As a life-long non-drinker / non-smoker I don't have personal experience to pull from, but I can tell you the experience of a young dear friend...
He is a bartender, so in his adult life he's always been in the environment that has been described by the OP. He developed a serious substance habit even before he became a bartender, socially at first. He soon got a DUI, lost his car and gave up driving, His career as a bartender began around this time, at local establishments which he could access on foot.
He developed a deep relationship with someone special who also had a substance habit, and over a few years they both deteriorated until they had a serious blow-out and broke up. There was a child involved, so the breakup was doubly painful for both of them.
At that time, pretty despondent, my friend cleaned up. So did his former partner. Cold turkey with the help of counseling and a physician, although they both also had each other, now as just good friends, and they both had other close friends who also provided emotional support. They both have been completely clean for going on 3 years now, and they're both thriving; happily, so is the child.
My friend is still a bartender, and part of his support group is actually made up of other local bartenders who also have gone clean. There are actually quite a few bartenders who do not drink, having gone through the desperate depths themselves, recognizing what was happening and turning around. If you ask around at your local bars, you'll probably find out a few of your bartender friends have gone through this.
Going back to my friend's story, he will probably be a bartender for a long time. He's really good at it and his talents are sought after by a number of establishments. The fact that he is clean is a big plus for many bar owners. So he's probably going to be in that environment for a long time. But, he's exposed to everyone in his corner of the world who wants drinks and he sees what it does to people. That in itself helps him to stay clean, and like other clean bartenders, it also helps him to be very ethical about his work as a bartender.
The easy answer about drinking is don't start drinking and don't be in environments that encourage drinking. That's how I have stayed clean and dry for 70 years., but it's pretty hard to do this if you're a full time gigging musician. When I was in my 20s and considered being such a musician, that was one of the major factors in my decision to pursue a more conventional non-music career; some of the other factors were a consistent and functional payroll, support for a home and family, and last but not least, health care and retirement benefits -- both which I'm particularly enjoying at this time in my life. And for me, putting a dollar sign on music just took all the fun out of it.
I had an older formerly full-time musician friend once tell me that if the whole music world was a bucket, the number of truly successful full time musicians -- who did not acquire bad habits, who thrived in their career, who could support a home and a family and who had real full-time benefits -- would be a drop in that bucket. Dedication to music is wonderful, but for the vast majority of full-time musicians, it comes at a pretty high cost.