Union Square is in Downtown San Francisco. If you are coming from out of town, you may want to consider the various forms of public transportation such as BART which has a station at Powell and Market. It is a short 3 block walk up Powell Street to Union Square.
If you are coming from Pier 39 you may ride the Powell Street Cable Car line.
You may also use the map below to calculate driving directions.