Coming from Hayward you will get off at the First San Francisco stop: Embarcadero station. Ferry Building is east of the station - huge building with a clock tower at the end of the street.
Embarcadero Station. That s the last SF stop before it goes into the tunnel under the bay. (Alternately: Coming from the East Bay, it s the first SF stop after the tunnel under the bay.)
Embarcadero station