Appreciated. More of the local bar/ pub/ bar food type. Staying at Union Square if you have any thoughts in that area.
You'll have to venture away from Union Sq for the local scene. The area is the 2nd largest tourist destination in the city behind the mess that is Fisherman's Wharf. But you have some well known SF establishments in the area that are worthwhile.
Bourbon and Branch is near Union. It's a gimmicky, whiskey-centric speak-easy on the edge of the Tenderloin but kinda fun for a drink.
I'd recommend heading into the Russian Hill area on and around Polk Street, you'll get your fill of the local scene. My suggestions there are Union Larder, Mezcalito, Ho's Bootleg Tavern, Kozy Kar (late night), and Robberbaron.
The Tenderloin right next to Union Sq, on its surface, is the "crustiest" part of SF so it's only locals, but has some cheap fare and a decent bar scene. My recommendations are
Mikkeller (best beer bar in town IMO),
Brenda's French Soul Food,
The Chairman for steam bun sandwiches, and Lers Rhos for Thai.
I second the previous suggestions for places on Embarcedero : Ferry Building, Hard Water (another whiskey bar), Water Bar, Pier 23 are all nice spots right on the Bay.
I highly recommend the bars/restaurants in the Mission for the local scene as well. The Mission is the hispanic area of SF, but is quickly becoming gentrified so offers both upscale locations and cheap tacos/burritos. My favorite spots on the cheap-ish side are
Papalote,
Wes Burger,
Sycamore, Zeitgeist, Burma Love, and Hawker Fare.