There are two main bottom bracket types. More common on older bikes is the cup and cone style shown to the left. On modern bikes the most common is the sealed cartridge bearing shown to the right. The easiest way to identify which you have is to look at the bottom bracket on the non-drive side of the bike. A cup and cone bottom bracket will have a lockring and adjustable cup. A cartridge will just have a cup with a splined interface.

For a detailed analysis of the varying types of bottom bracket see the Wikipedia article.

A cartridge bottom bracket is a sealed unit and once worn out the whole thing is replaced.

Cartridge bottom bracket replacement:

Remove both crank arms

Use a bottom bracket tool to remove old unit. Remember most modern bikes use English threads so the drive side cup will be reverse threaded and unscrews clockwise.

Clean bottom bracket threads in frame with degreaser and rag.

Apply grease to the frame threads and bottom bracket threads.

Insert the bottom bracket into the frame. Make sure it is oriented correctly, left and right should be marked on the shell. Typically the drive side cup will be fixed to the shell and have a raised flange. Take care when threading the bottom bracket into the frame, it is easy to cross thread. If the cup has a raised flange tighten until the flange is tight against the frame.

Fit the other cup again taking care to avoid cross threading. Tighten until it is tight against the shell.

Remove the lock ring of the adjustable (left side) cup. There are several ways to do this, the best of which is to use a large Sugino or Campagnolo (or equivalent) lockring spanner, which looks like a curved finger that fits around the lockring with a hangnail that goes into the lockring slot. In a pinch, an adjustable pin spanner can also be used to grip the lock ring. The direction to turn depends upon the style of adjustable cup; English/French, Italian, or Swiss.

There are a few types of adjustable cup: One type has holes in it designed for a pin spanner to unscrew. This tool looks like a giant pair of tweezers with one pin on each tang. A picture of this can be seen here http://www.sheldonbrown.com/tooltips/images/bbtools5.jpg The other type looks like an adjustable spanner would fit, but in practice a chisel and a mallet is often the only way to turn it round and out.

Once the left cup is out, remove the ball bearings (usually in a retainer) and the bottom bracket spindle, and then the right side bearings. Note which way the retainer comes out and be sure to replace it the same way round. It is not necessary to remove the fixed cup over on the right hand side, and because of the difficulty and chance of damaging the fixed cup flats, removal is not recommended if you want to keep it.

Clean all bearing surfaces using a penetrating solvent to dissolve congealed grease. Inspect for pits and discard and replace any pitted cups or a pitted spindle. Remove individual balls from the retainer and clean thoroughly before replacing them.

Grease the cups and bearings liberally using a good quality commercial grease made for this purpose. Use copper grease ONLY on the screw-threads and reinstall the right side bearings and bottom bracket spindle. If the spindle is asymmetric be sure to orient the longer side of the spindle on the right (drive side) of the bike. Place left side bearings into the cup and gently screw the cup back onto the frame. Take your time and use only your fingers until you're certain that it is not cross-threaded. Do not force it! It is easy to strip or foul the bottom bracket threads by mistake. Continue screwing with the pin tool (or adjustable spanner) once the cup gets deep into the bottom bracket shell.

When the bottom bracket feels tight, check for play by grasping the spindle and yanking in and out on the spindle and listening / feeling for play. It is better to be a little bit too tight than too loose. When the lockring is secure the play will increase ever so slightly. When all the play is removed, thread on the lockring and tighten with lockring spanner (here, a pin spanner cannot provide enough force to secure the lockring permanently.) Tighten the lockring until it can go no further.

Listen to your bike, and take notice of what it feels like, when you are riding. Through your feet, via the pedals, you can diagnose many power-drive-related problems, including whether the bottom bracket is in need of maintenance.

If you can hear or feel a periodic (i.e. once per crank revolution) creak or ticking noise when the system is under high or even normal load, it could be time to regrease or replace the bottom bracket. The creak, click, or rough feeling usually occurs as the crank arms pass through one particular point in their cycle; if it does, then you have a problem with either the bottom bracket or possibly the pedals themselves (check this latter simply by spinning the pedals with your hand; they should spin freely). The creaking in the bottom bracket can be caused by the on-set of corrosion (due to frequent exposure of this part of the bike to water and dirt).

For total confirmation of a worn bottom bracket, remove the crank arms and spin the spindle by hand; you will quickly be able to tell if it is in need of maintenance or replacement.

Great care and cleanliness is necessary to protect the thread of the bottom bracket in the frame. This is the only part of the whole bicycle that is vulnerable to "wearing out", sometimes by running in a loosened condition. Or, perhaps more commonly, be damaged beyond repair by carelessness (eg cross-threading) in the workshop. The common practice of tightening the locking ring with a hammer and chisel will damage the ring (no great problem, it is replaceable) but is also ineffective in providing sufficient torque.