Visitors to Tallinn planning  three journeys or less on public transport should buy the singe journey tickets costing 1.60 Euros from the driver directly when entering the vehicle (precise change where possible ). 
If you plan to use the public transport on more than three occasions while in Tallinn, it is cheaper to purchase the smartcard (Ühiskaart) and to top it up with money. Hourly tickets cost 1.10 Euros. You need to activate your ticket by touching the orange validators at each entrance of the vehicle at the start of every journey. 
If however you want to combine the transport and sightseeing while in the city, consider purchasing Tallinn Card as it includes a hundred sights and museums along with free use of public transport. Note that you still need to validate your Tallinn Card at the start of each journey in the public transport vehicles.