Build. More. Shelters.
I live in New York and we have more homeless people per capita than San Francisco but we don't have the same kinds of problems. The very simple solution is to build shelters. The rate of homeless that are sheltered in NY is WAY higher and as a result we don't have the same kind of problems.
In SF 492/100k residents sleep on the street. In NYC the rate is 45/100k.
Source: https://medium.com/@josefow/new-york-decided-to-end-street-h...
(among others, these aren't controversial numbers)