That's not how it works at all. You can't pressure people into becoming a productive member of society.
What you can do when it already happened is kill them or make them die in some ways, jail them or try to support and/or treat them.
I hope it goes without saying that letting them just die or killing or jailing them is not an option in a western society.
Prevention is much more favorable of course. For example, don't let people become homeless easily. But even then, a significant amount will become homeless.
Until you accept that they didn't 'easily become homeless' the problem will continue. They used drugs and spiraled, usually over the course of many months or years, forced all their friends to turn their backs on them, got kicked out of any living situations they had access to because of drug/alcohol use or theft to support the same and finally ended up on the street.
On the street they have access to almost endless support, at least in Silicon Valley, but much of that support is contingent on things like not openly using heroin or not repeatedly getting so intoxicated that they defecate or vomit on themselves, so they refuse it.
I don't care how liberal you are, no society is functioning when it allows people to get on BART and pee on themselves and defecate on the cloth seats and walk up and down the aisles dripping feces and urine on the floor. That is allowed and nothing is done about it for fear of upsetting homeless 'rights' groups who are funded by the tax dollars meant to help homeless people.