Lubrication is important to many functions on a bicycle. It helps moving metal parts rub against one another without creating high-pitched noises or warped metal. Pedals don't require grease or lubrication to the extent a bike chain or gears would since these parts are expensive and highly complex to replace. But dirt, sand and dust can conspire to wear down the threads on pedals, making it tougher to pedal smoothly and shortening the lifespan of these parts. For this reason, it's wise to grease your pedals a few times each year.
Remove the pedal from the crank arm with a wrench. Most pedals can be removed by loosening the nut on the interior side of the pedal--an adjustable wrench works well for this, and many of these nuts are sized at 15 mm. Some pedals, though, require an Allen wrench and are loosened by placing the Allen wrench in a hexagon-shaped hole at the exterior end of the pedal. Fully unscrew the pedal from the crank arm and remove it.
Clean the pedal threads on the crank arm with a clean cloth or rag. It's best to press tightly and follow the pedal threads around the crank arm to best clean out the grooves. After this, wipe down the exterior of the pedal, including the entry point for the crank arm.
Apply a liberal layer of grease onto the pedal threads. When the pedal is replaced onto the pedal threads, the spinning motion will disperse the grease throughout the interior of the pedal. It's better to use a large amount of grease rather than a small dose to ensure the grease reaches all the way inside the pedal--excess grease will run off the pedal with use.
Screw the pedal back onto the pedal threads of the crank arm. If you're concerned about the grease making it all the way through the pedal, you can unscrew it again and replace it to disperse the grease.
Tighten the pedal the same way you loosened it with the wrench, turning to the right instead of the left.
If you take your bike on dusty or dirty terrain frequently, you should consider greasing the pedals once a month.