This fix is not always easy. It will probably require some practice, but the results and satisfaction will be worth it. Most bicycles these days have 24 or more speeds, achieved by mounting 3 sprockets at the pedals and 8 or more at the rear wheel (3 x 8 = 24 speeds). Shifting is controlled by levers at the handlebars, connected by cables to the front and rear derailleurs. The derailleurs--devices through which the bike's chain passes--move from side to side to shift the chain from one sprocket to the next. There are only two factors that affect the derailleur's function: cable tension and derailleur alignment.
Adjusting cable tension
Begin by inspecting each shift lever. These are usually located directly on the handlebars. On older bicycles, they are sometimes attached to the frame, immediately below the handlebars. If there is a screw securing the lever, be sure it's tight and that the lever stays in whatever position it's set in. If you're lucky and deserving, this will fix the problem. Take the bike for a test spin to find out.
Find, on the front derailleur, the cable coming from the handlebar. The front derailleur is attached to the frame, just above the front gears. At the derailleur, use an Allen (hex) wrench to undo the nut or bolt that secures the cable (see illustration).
Using only your hand, pull the cable taut (pulling with pliers creates too much tension). While holding the cable taut, resecure the cable with the nut or bolt.
Repeat steps 2 and 3 for the rear derailleur. The rear derailleur is attached to the frame and hangs just below the rear gears.
Shift through all the gears while riding the bike to check your adjustment. If shifting is still not perfect, you'll need to adjust the derailleur alignment (see below).
Adjusting derailleur alignment
Have a helper lift the rear wheel of the bicycle slightly off the ground.
Kneel beside the bike and turn the pedals slowly by hand. Using the shift lever, adjust the front derailleur so that it rests at about the midpoint of its movement range.
If the initial problem is that the chain won't shift onto the largest rear gear, locate the two small side-by-side adjustment screws on the rear derailleur. Turn the left (or upper) adjustment screw counterclockwise a quarter turn with a small Phillips screwdriver. If the initial problem is that the chain won't shift onto the smallest rear gear, skip to step 6.
Continue turning the pedals and shift through all the rear gears. If the chain will still not go onto the largest rear gear, shift the chain back down to the smallest rear gear. Turn the right (or lower) adjustment screw clockwise as far as possible before the chain begins to click or rattle.
Shift through the gears again to test. If necessary, turn the left (or upper) screw counterclockwise another quarter turn.
If the initial problem is that the chain won't shift onto the smallest rear gear, begin by turning the right (or lower) adjustment screw counterclockwise a quarter turn. Shift through the gears to test.
If the chain still won't go onto the smallest rear gear, shift the chain to the largest rear gear. Turn the left (or upper) adjustment screw clockwise as far as possible before the chain begins to click or rattle. Shift through all the gears to test.
Follow steps 1 through 7 for the front derailleur, which operates on exactly the same mechanism as the rear derailleur (you still lift the rear wheel in step 1). There are two side-by-side adjusting screws that control alignment.