When the shifting performance of your bicycle gears becomes less reliable, a loose gear cable is often to blame. Each set of Shimano bicycle gears features a cable-actuated derailleur. The derailleur "derails" the chain from one selected gear to another, but only if its cable is adjusted properly. Lack of cable tension (which happens over time because of common cable stretching) causes the derailleur to respond sluggishly. If overly loose, the cable will not allow the derailleur to fully shift the chain to the next gear.
Shift the front gear to the outer chain ring and the back gear to the outer rear cog. This combination will place the chain farthest from the inside of the bicycle.
Use a 5mm Allen wrench to loosen the gear cable bolt on the bottom of the rear derailleur. If you're unsure where to find this bolt, simply follow the cable from the shifter to its terminus at the other end.
Turn the barrel adjuster at the back end of the rear derailleur all the way into the body of the derailleur. Then, give it two turns in the opposite direction. As the name implies, the barrel adjuster is barrel-shaped.
Use needle-nose pliers to pull the end of the shift cable taught, and re-tighten the gear cable bolt over the gear cable.
Shift to the next rear gear. If the shift is sluggish, give the barrel adjuster a quarter-turn in toward the bike, and check the adjustment once again. Continue this adjustment until the chain responds fully to the shift.
Shift the rear gear so that chain is positioned in the centre of the cluster of gears (known as the "cassette"). Observing the back of the derailleur, you should find that the derailleur is positioned directly beneath the chain. Turning the barrel adjuster counterclockwise on the derailleur will move the derailleur in toward the bike. Adjust it as necessary.
Shift the front gear to the smallest chain ring and back gear to the innermost rear cog. The chain will now be at its closest point to the inside of the bike.
Loosen the gear cable bolt on the front derailleur. Once again, if unsure of the bolt's location, follow the cable from the shifter to its terminus. In this instance, the derailleur is located over the front chain rings.
Turn the barrel adjuster along the cable all the way in toward the bike. Depending on which Shimano design gear shifters you have, the barrel adjuster will be located either midway along the cable on the side of the bike or where the cable enters the body of the shifter.
Give the barrel adjuster two turns in the opposite direction (after you've turned it all the way in). Grab the end of the cable with your needle-nose pliers, and pull the cable taught. Retighten the gear cable bolt over the cable.
Shift to the next largest front gear. This should move the chain from the small chain ring to a larger chain ring. If the chain responds sluggishly, add more tension to the gear cable, by turning the barrel adjuster counterclockwise. Check your adjustment each time. The adjustment is correct once the chain can shift back and forth easily between the chain rings.