The hard part is finding affordable ways to do so. This is compounded by the fact that a large portion of the homeless suffer from mental health problems (my mother was in that boat).
On the mental health front, we need to collectively find a way to institutionalize the mentally ill in a manner that is fair and humane. That should include indigent drug addicts who are unable to care for themselves.
It's not, though. Seattle ran into loads of problems with housing-first policies where the houses would get trashed and people with substance abuse problems would continue camping out as groups.
2) Build subsidized housing. SF likes to complain about the end of the state redevelopment agencies but did you know that with just one year’s worth of the $7B a year windfall from the much-despised Tech (difference between the 2022 and 2008 budgets), SF could buy or build a $1M condo for every single of the 7,000 homeless men, women and children in the city? Instead at least half of that was captured by civil self-servants in the city bureaucracy in the form of salaries and benefits.
3) Restore involuntary committal of some mentally ill unable to care for themselves, that was abolished by the well-meaning but clueless Lanterman-Petris-Short Act in 1967
4) means-test rent-control (half of SF’s residential units), which creates haves and have-nots and raises prices to astronomic levels for new entrants
5) remove land-use restrictions like single-family zoning that covers half of the city
And the “SLC solved homelessness” was a last decade story that has already unraveled due to sustained and increased funding not being applied (again national problem, local solutions can’t do much).
Salt Lake City, that bastion of left-liberalism (/s) does a much better job, specially at preventing vulnerable people from becoming homeless in the first place.
Ultimately SF’s problems are well understood and the solutions as well, but there is no political will to confront the entrenched interests that led to this and an apathetic electorate that does not demand accountability is responsible.