In some places there is a step where if a person is a danger to them self or others, you can fill out a form for court appointed psych out patient therapy.
You can get an involuntary hold on someone but then getting them out can be difficult and expensive. It may take a doctor, nurse, EMT, cop, and/or judge to agree with you and they see the truly crazy people who really need a bed.
Other than that, trying to barter with the person, or a cop. Depends on the size of the city.
Keep in mind, there could be backlash and failure to get them help. We had to cut a friend and her husband from our circle because all steps failed. We grew tired of the same repeated stories with slightly different plots. The person tried to get other friends fired by making up stories. I feel like we did all we could and needed to move on with our lives.
I also wound up on a 72 hour hold prior to that in the county detox (picked up while drunk by cops) and immediately started drinking the moment I left, so it can take more than one commitment to prompt change, if change is ever prompted.
Do keep in mind that you might irreparably damage a relationship by committing someone against their will, YMMV.
For extreme example, how do you get someone committed to an IMD, given that that person genuinely needs it? What can be done less drastic than that, by people who care and are willing to turn the crank on a slow legal system?