Build houses for them, for one. Make housing cheaper in the first place, so they don't go on the streets. At a bare minimum, at least have sufficient shelters for them so they don't have to sleep on the streets. (Almost) no one wants to sleep on the street, and San Francisco has more than enough money to make it so they don't have to. Heck, some individual Bay Area companies have enough money for it, not that they would ever spend it on the homeless.