Don’t rely on your hostel/hotel’s transportation! They’ll overcharge you, and getting a taxi at the airport is simple.
Take Green Taxi from the airport to your destination. It’s 50 soles (Peruvian currency) or $20.
Fifty soles is the better deal. You can exchange some money at the airport, and then exchange money on the street later where you’ll get a MUCH better rate. (NOTE: Most people on the route to Machu Picchu accept cash only!)
To get back to the airport, use a service called EasyTaxi. Download it to your phone, type in your location, and a safe cab will pick you up within 5 minutes. Getting around Lima shouldn’t cost you more than 20 soles (~$6). The app even tells you how much the fares are beforehand so there’s not confusion, bargaining or cheating!
The app gives you the option to connect your credit card, but just pay in soles for everything. Also note that cabbies rarely have exact change so try and carry as many coins as possible.
You can also use EasyTaxi to get around Lima and Cusco. You should avoid using local cabs because it’s oh-so common to get robbed in a cab.