Replace your chain every time you replace your cassette. Worn cassettes allow the chain to slip over the sprocket teeth, rather than to mesh securely into the valleys.
The standard fitting for attaching sprockets to the back wheel is the cassette. The cassette fits over the ratcheting mechanism, the freehub. This is bolted onto the hub, with the bearing at the outboard end. The freehub allows the wheel to go round on its own without pushing the pedals, that is to freewheel. The freehub makes a clicking noise when you freewheel. Cassettes and freehubs are made by different manufacturers, but all adhere to the standard Shimano-fitting pattern. The outer shell of the freehub is splined, a fancy way of saying it has grooves in it. The cassette has a matching set of grooves to slide over the freehub. Everything is kept in place with a lockring, that screws into the outer end of the freehub. The first common cassettes were seven-speed. When eight-speeds were introduced, they needed a longer eightspeed freehub, but seven-speed cassettes and freehubs are not compatible with eight-speed ones. However, nine- and 10-speeds pack more sprockets into the same space, so nine-speed and eightspeed cassettes both fit onto the same freehub. The lockring makes a horrible noise when it starts to loosen. Don’t worry! The lockring has a serrated surface that locks onto the serrated face of the cassette. These crunch when separated.
Step 1: Remove the back wheel from the frame. Remove the quick-release skewer or nut and fit the cassette-removing tool into the splines on the lockring. Make sure it fits snugly. Some tools have a hole through the middle so that you can refit the skewer or nut and hold everything in place, which is handy. Alternatively, for quickrelease axles, use a tool with a central rod that slides into the axle and steadies the tool.
Step 2: Fit a chain whip around one of the sprockets on the cassette, in the direction seen in this picture. This will hold the cassette still while you undo the lockring. Fit a large adjustable spanner onto the tool – you need plenty of leverage so the handle will need to be about 30cm (12 inches) long.
Step 3: Place the wheel in front of you, with the cassette facing away. Hold the chain whip in your left hand and the adjustable spanner in your right, as shown. Pull the two tools apart to release the lockring. If you bolted the cassette lockring tool on, you need to loosen it once the tool starts to move, to make space into which the tool can undo. Remove the lockring, then slide the cassette off the freehub by pulling it straight out from the wheel.
Refitting the cassette
Wipe clean the splines of the freehub. (It is a mistake to use degreaser, as this drives grease from the axle bearings and freehub bearings.) Use the opportunity to check the wheel spokes, which are normally hidden behind the cassette – they get damaged if the chain comes off the biggest sprocket and catches behind the cassette, but you can’t usually see the wear. If any are damaged, you have to deal with them. Slide the new or cleaned cassette onto the freehub. One of the splines is fatter than the others and has to be lined up with the corresponding spline on the cassette. Push the cassette all the way home. The outer rings are usually separate and must be correctly lined up. One of the separate rings may be narrower than the others and needs the supplied washer behind it. Grease the threads of the lockring, then screw it onto the centre of the cassette. Refit the cassetteremoving tool and the adjustable spanner, and tighten the lockring firmly. You do not need the chainwhip for this since the ratchet in the freehub stops the cassette rotating in this direction. When the lockring is almost tight, it makes an alarming crunching noise. This is normal! The inner surface of the lockring has friction ridges that lock onto the cassette to stop it working loose; they will click as you tighten it down.
Source : BIKE MAINTENANCE TIPS, TRICKS & TECHNIQUES
See also bike maintenance tips, tricks and techniques “Stiff links”