I moved to San Francisco from the UK about 10 years ago. Fortunately California has relatively strict gun laws so San Francisco is pretty safe for the US if still bad for a developed country.
Homicides per 100k (from a couple of years ago):
San Francisco: 4.5
US: 6.3
UK/France/Germany: 0.8-1.2
(While most of the difference is due to availability of guns the US is just generally more violent and despite what Trump says the US has 1.5x the knife murders of the UK as well as 70x the gun murders. https://www.euronews.com/2018/05/05/trump-s-knife-crime-clai... )Living in the Mission there are a handful of shootings per year. But it's a pretty dense neighbourhood so per population it's probably pretty normal for the US. The level of street homelessness is shocking but not as bad as downtown and you get used to that after a while too. Petty crime is definitely a problem.
Personally I worry more about being hit by a car crossing the road since cars are allowed to drive through the pedestrian crossing even when there is a walk signal.