From the main station (Hauptbahnhof)
From the airport
Tickets should be bought BEFORE boarding train or tram; there are machines at all stations and tram stops. If you are travelling more than once, it may well be cheaper to buy a 'Tageskarte' (24 hour ticket).