The best way to get around Salzburg is by foot. There is a network of city buses, the StadtBus, with numbers from 1 to 8 (O-Buses, electric) and 20-27 (fuel-powered). A single trip in the bus is €2.40, a 24 h ticket €5.30. which covers the whole city. If you travel by bus, make sure you catch none of the last buses. They will take you several miles out of town with your only way back being by walking or taxi. With that said, if you need to get somewhere late at night it may be best to take a taxi or walk.
Conveniently, bus tickets can be bought on the buses from the bus driver. However, if you have time, buy the tickets in advance at a "Trafik", since they are then significantly cheaper. For example, a single trip then costs only €1.60, but you have to buy the tickets in blocks of 5. Single tickets are also available from automatic machines at central bus stops.
The "Lokalbahn" train has a separate train station under the main train station and travels in the direction of Oberndorf and Lamprechtshausen. Tickets can be bought on the train.
Another option for exploring areas around the main city (Bad Ischl, Fuschlsee, etc.) are the POST-BUSes. These also leave from the main train station; tickets can be bought from the driver.
Finally, another excellent option is renting a bike. Salzburg has over 100 km of bike paths, and using this mode of transportation is often faster than bus, car or foot. There are also excellent bike paths on either side of the river which you can follow to either Freilassing (35 min), Oberndorf or Hallein (each about an hour away).
Having arrived at the airport (Flughafen Salzburg) it is very easy to make your way into the town centre by electric trolleybus or other modes of transport. Tickets for these services can be bought easily from the bus driver and you can travel from here to the "Hauptbahnhof" main station where you can reach many destinations, predominantly in Austria, but also across the whole of Europe.