The most common fitting you'll find will be for a chainring to be attached to square taper cranks. If you want to replace the chainring, it's a much easier job if you first remove the drive side crank. Chainrings are connected to the crank via chianring bolts that require a special tool to tighten and loosen. You may want to replace a chainring because the teeth are worn, or because you want to adjust the gearing ratio.
This is a long guide, so you can choose to either watch the entire video above, or follow it in smaller chunks by clicking on the individual steps below.
Steps to Replace The Chainring On A Square Tapered Crankset:
The commonest type of cranks are aluminium, with square holes that fit onto a tapered square section axle. A nut or a bolt pulls the crank onto the taper to jam it on. They usually need a special tool called a crank-puller or crank-extractor to pull them off the axle.
Some bottom brackets can be adjusted to tighten or loosen the bearing. Others are fit-and-forget, when they wear out the whole unit must be replaced. Some have cartridge bearings that can be replaced. Identify an adjustable bearing by the lock-ring on the left-side cup
Modern bikes usually have cranks made of aluminium, they are mounted on an axle made of harder material, usually steel. If there's any play between the cranks and the crank axle the soft aluminium will soon get worn to the point where it's impossible to lock the cranks. If the cranks are loose don't ride the bike.