Remove the crank bolt first
Before a crank arm can come off, the bolt that holds it to the spindle has to come out. On square taper and many Octalink and ISIS cranks, the bolt sits under a dust cap or in the middle of the arm. Remove the cap if it has one, then take out the bolt and its washer. Keep the washer with the bolt so it goes back in the same place.
The bolt is turned with a hex key or socket, depending on the crank. Check which tool fits before you put force on it, because a rounded bolt head is hard to fix.
Mark the sides
Mark the drive side and the non-drive side before you remove anything. The drive side is the side with the chainrings. The two arms are often marked L and R, but do not rely on that alone. A small piece of tape with a letter works well.
Note the order of any spacers or washers between the arm and the bearing. Lay them out in a row so you can put them back the same way.
Use a crank puller
A crank puller is the right tool. Thread it into the threaded hole in the arm, then turn the center bolt of the puller so it presses against the end of the spindle. The arm is pushed off the spindle as the bolt tightens. Turn slowly and check that the puller is square to the arm.
Choose a puller that matches your crank. A puller made for square taper will not suit an Octalink or ISIS crank, and a puller for one crank can damage another. If you are not sure what the crank is, read square taper vs octalink crank before you buy.
Why not hammer it off
Hitting the end of the crank arm with a hammer is a common mistake. It can crack the arm, bend the spindle, or damage the bearings. A puller applies even force and is much safer for the parts.
If the arm will not come off
Check the basics first. Make sure the bolt has been fully removed, that the puller is fully threaded in, and that the puller is square. Some arms stick because of corrosion, and a little penetrating oil can help, but let it sit before you try again. If the arm still will not move, stop and take the bike to a shop. Forcing a stuck crank can damage the spindle or the arm.
After removal
Once both arms are off, you can service the bottom bracket or inspect the spindle. The reinstall steps are in how to install crank arms correctly. Put the arms back on their own sides, in the same orientation, and torque the bolt to the crank maker’s value.