In the old days, pilots followed railroad tracks, rivers, and other landmarks that could lead them where they wanted to go.
However, when you fly at 35,000 feet like airliners do, this can't work very well. Up there pilots follow airways, which are like highways in the sky. The airways are connected by navigation beacons. Pilots follow signals from one beacon to the next until they reach their destination.
There are three basic ways that pilots stay on the airways. First, those beacons, called Very high frequency Omni-directional Radio", or VOR's, send out signals. Using VOR receivers, pilots follow those signals straight to a beacon, where they pick up the next signal, and keep going. Pilots can also use Distance Measuring Equipment. DME's measure a plane's distance from two beacons, and then calculate the plane's exact location on an airway. Finally, the newer planes use the Global Positioning System.
On-board the airplanes is a computer called the Flight Management System. The computer gathers the different navigation signals, plots the course on a map, and the pilot flies that course.
Air traffic controllers are the traffic cops, making sure the airways run smoothly and safely.