We (Wife, Son and I) visited a few years ago and loved the city, well most parts of it anyway.
We were really surprised by the amount of homeless people though!
We walked everywhere without issue and tried to stay clear of the well known hot spots. We did end up in the Tenderloin area accidentally (during the day) at one point and made it out safely
I’d go back again.