Public Transport of Thessaloniki otherwise known as OASTH has a very informative webpage with detailed info for tourists and visitors. Whether you come to the city by plane, train, ship or bus, there is always a direct link to the city centre.
Go to the main page, click on english, and you can get detailed info on bus routes, time schedules, find your exact location on the map and the best route suggestion for your destination. There is even a mobile app so you can schedule your trips while on the move without loosing time !
It is better to buy a ticket in advance and cancel it in the bus. If you don’t, you have to option to get one at the machine inside, as long as you have the exact amount. More info on where to find tickets here.