Every American city has rough parts (some more than others, including SF). There are definitely some very miserable and dangerous parts of San Francisco: Tenderloin, SOMA, Civic Center. But as someone who has lived here a while, I think this narrative that it's nothing but homelessness and crime is misguided. If you go West of Van Ness, there are so many beautiful and lively neighborhoods. Haight Ashbury, Hayes Valley, North of Panhandle, Pacific Heights, Japantown, Castro, Golden Gate Park, Inner/Outer Sunset, Inner/Outer Richmond, etc. The problem is that tourists mostly see the bad parts, probably because they're most accessible by public transit. The northern-most Caltrain stop is not in a nice area for example. There's a reason it's so enormously expensive to live here: demand.