Sofia has a good public transport system as there are trolleybuses, trams and buses. There is also a subway. The cost of one ticket for any kind of transport is 1.60 BGN (0.80 EUR). The ticket is only valid per trip (meaning that if you have to change buses, you need two tickets).
Keep in mind the tickets for on-ground transport are not valid for the subway and vice versa (but the tickets for the buses, trolleys and trams are the same). You can also purchase a day ticket which is valid for any kind of transport in the city until midnight on the same day. It costs 4 BGN (around 2 EUR).