If the chain is indexing (not shifting between the gears properly), then you will need to adjust the
barrel adjuster.
With the bike upside down, adjust the barrel
adjuster by undoing it with a quarter turn at a
time.
Rotate the pedals and press the rear gears to
check whether they change smoothly. If they
don’t change smoothly, try adjusting the barrel
again until the gears change correctly.