Choose a downtown hotel. While you can find lovely places to stay outside the city and in tourist areas like Chinatown, the difficulty of driving and parking in San Francisco makes a central location ideal for wandering local areas. Focus on North Beach and the Financial District for best access to BART (bart.gov) train and MUNI bus (sfmta.com) stations, which are relatively cheap and easily accessible.
Grab local publications. Upon arriving in the city, look in coffee shops or on street corners for one of San Francisco's free weekly newspapers. The SF Weekly and the San Francisco Bay Guardian are the oldest and largest. These papers are written for locals and will have information about events and restaurants that aren't tourist-oriented or cliched.
Use Yelp (yelp.com/c/sf) to find food and drink. Most cities are now in the Yelp network, which gathers user reviews to highlight locals' favorites, but the service began in San Francisco and has an extremely deep and active directory for that location.
Go on walking tours. San Francisco is a very walkable city, and certain neighborhoods are best explored on foot. SoMa (south of Market), Noe Valley and Pacific Heights are all walkable, non-touristy neighborhoods full of interesting shops and cafes to explore.