Visitors to Machu Picchu typically leave from Cusco, either on a day trip, or overnighting in Aguas Calientes, which allows you to visit the park early or late in the day and avoid the worst of the crowds, and on sunny days, gives you a nice window of reprieve from the beating sun. Don't forget sunblock.
There are 3 ways to reach the ruins themselves: arrive on foot via the multiple day Inca Trail trek, or walking or taking a bus from Aguas Calientes.
If arriving from Aguas Calientes, prepare to spend a lot of time waiting in lines throughout the day.... you'll be in line for the bus, which drops you off at the end of the often long line at the entrance. You'll queue up again if interested in scaling up Wayna Picchu or the Temple of the Moon, and then just when you thought it was all over, you'll be in line for a bus back down to town which, even in low season, can be as much as a couple of hours wait. This is when you may want to reassess how much energy you have left, and maybe start walking back down.
Repairs to the train service that took place in early 2010 have now completed, and there should not be any issues on the rail road to Machu Picchu. It is also possible to get to Aguas Calientes by traveling through Santa Maria and Santa Teresa. This alternate route involves walking (1 or 3 hours) and crossing a river in an "oroya", a basket riding over a cable to the other side.