Bike pedals come in an array of types and designs, but most pedals screw into the crank with a 15 mm pedal wrench. A few pedals need a 9/16-inch wrench, or even a 6-mm hex wrench to use on the back of the crank if they don't have flats on the axle. Check your bike before you begin to make sure you have the right tool. Move your bike's chain onto the largest front chain ring before you begin to protect you from the teeth of the chain ring.
Clamp the seat tube of your bike frame in the repair stand, lean the bike against a wall or turn it upside down to rest it on the handlebars and seat. If using one of the latter two methods, having someone to help you hold the bike steady through the next steps is extremely helpful. Stand or kneel, as needed, on one side of the bike, facing the pedal.
Position the wrench on the flat parts of the pedal axle. Turn the bicycle's left pedal, as viewed from the rider's perspective, clockwise, or counterclockwise if you use a hex wrench on the back of the axle. For the right pedal, turn the wrench counterclockwise, or clockwise for the hex wrench.
Get a stuck pedal axle moving by laying the bike on the ground with the pedal pointing up and putting a few drops of chain oil around the axle where it screws into the crank. Wait five minutes and try the previous step again. Repeat once more if necessary.
Remove the pedal from the bike. Wipe off the interior threads of the crank and the threads on the pedal axle. If there's rust on the threads inside the crank, use a wire brush to lift the rust and wipe it off with the rag.
Select the replacement pedal that matches the side of the bike you're working on. All pedals have L or R markings, or D and G markings in the case of French pedals. Apply a thin layer of the bicycle bearing grease to the axle threads of the replacement pedal.
Screw the pedal into the crank by hand, in the reverse of the direction you used in Step 2. When it gets too difficult to turn by hand, finish with the pedal or hex wrench, making sure the axle threads disappear inside the crank, but not using excessive force.
Repeat for the other pedal.