From Cusco, you can take a bus or train to Machu Picchu. From Lima, you can take a flight to Cusco and then take a bus or train to Machu Picchu.