Square tapered cranks are the most common type found on bikes. It's easy enough to replace the cranks, but a specialist tool know as a crank-extractor is used. Once you have completed the job, be sure to check they securely fastened. A damaged crankset is expensive to replace.
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 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.
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.