Lviv doesn't have good transport infrastructure, for now, so start practicing meditation.
There are 3 different means of transport in Lviv: buses, trams and trolley buses.
The most common means of city transport are small yellow buses, called "marshrutka". The fare is 5.00 UAH irrespectively of the distance of the trip. The money is paid to the bus driver directly in the bus after you get in, and there are no tickets you can buy in advance.
Irrespectively to the distance of your trip, tram and trolleybus fare is 3.00 UAH (regular) and 1.50 UAH (discount for students). You can buy a ticket in the newspaper shops, which you can find on the most of the stops, or directly from the driver in tram/trolleybus. After buying a ticket, you have to validate it, which is to stamp it with a particular ticket-stamping machine, called composter, which can be found on the inside walls of the tram/trolleybus. Otherwise, your ride is illegal. Each tram/trolleybus has its composter which stamps your ticket with a particular pattern. It is essential to keep your validated ticket until the end of your trip. Discount ticket is valid only if you have your student card or other document classifying you for a discount during your ride with you.
You can also buy monthly or annual tickets for tram/trolleybus.
Also, there is a mobile application – Pryvat24, to which you can bond a credit card and by a ticket directly in tram/trolleybus scanning its QR-code which is usually displayed on an inside wall of a tram/trolley bus. The same app also allows you to stamp your e-ticket.
Nowadays means of public transport in Lviv are equipped with GPS navigators, so you can easily follow their positions online. Also, you can find appropriate buses you can use to reach your destination online or using the application on your smartphone.
You can use web resources like Google maps, EasyWay public transport, Львівський транспорт, Lviv Router etc.
Please, be aware of pickpocketing inside the public transport.
Frankly speaking, public transport for Lviv residents is a disturbing question because of the condition of machines and number of people it can fit during one ride. So people, mostly young generation, and of course depending on the distance to the destination, prefer walking, which is on the other hand good to keep you fit.