This is 4 hours of sightseeing time, not 4 hours layover.
My idea with no car:
San Francisco side of Golden Gate Bridge
Too weird: Hiller Aviation Museum - doesn't have broad appeal but I'd like that if I'm by myself.
My idea with a car:
University of California, Berkeley
Presidio and/or Marin County side of Golden Gate Bridge
Golden Gate Bridge
Even if you have four hours there's not enough time to do Muir Woods as you have to get there and back. If its a weekend you're going to have to contend with Traffic.
If its your first time in SF I would stick with no car.
Take the BART to Montgomery/Powell
Cable Car to Fisherman Wharf
Bus to Coit Tower
Walk back down have something to eat at North Beach or Chinatown
Get back on the BART to the Airport
Alcatraz also requires some specific timing as there is only a set number of ferries and times. You could easily spend a couple of hours on the island.
If you have four hours in SF proper, I'd do Alcatraz (assuming the timing works) and pick one of: Chinatown, North Beach, or Fisherman's Wharf. You probably won't have time for the cable car if you do Alcatraz, especially if we're talking about a weekend or good-weather day, when the lines can be long. FW is obviously a tourist trap and not representative of the rest of the City, but it's still something many tourists like to see. It all depends on your tastes.