Many riders, swimmers, weight lifters, and other athletes shave their legs to ease rubdowns, for aerodynamics, for cleanliness, and for appearance. It is, after all, cheaper than shelling out for a new frame with aero tubing!
Many of the athletes who shave their legs have no problems beyond the occasional nick. A duller blade or electric razor would help for that. However, some people have problems with rashes, infections, or really itchy legs, and thus must be more careful.
Before you do anything, wash your legs with soap and water, using a wash cloth. This clears out the dirt which contributes to infections, oil, and dead skin cells. It is convenient, because of this, to shave after a shower.
Use a Good Razor
It is important to have both a good razor and quality blades. Features such as lubricating strips are preferable. Some prefer slightly dull blades and discard the blade when the lubricating strip expires, and some find that they have to make a mess of their legs to get a smooth shave with a dull blade. Electric razors have become really inexpensive of late, and it's difficult to spend more than $100 on a quality model.
Use Shaving Cream
Really. Shaving cream gives you a better shave, reduces the amount of skin you scrape off with the stubble, reduces shaving cuts, and it does a lot to prevent infection. Electric razors have both preshave positions and aftershave, both of which fulfill the same roles as shaving cream in lubricating and disinfecting. The cost and time addition is minimal, especially considering how much it improves the quality of the shave and reduces rash and infection.
Many prefer the gel type of shaving cream, and look for brands with Aloe and Vitamin E.
Use Icy Water
Do not use hot water, do not use warm water, use the coldest water you can stand. Run the cold water over your legs before you start, and rinse the blade often in cold water.
Warm or hot water dries your skin, anyway.
Take Your Time
Be especially cautious and meticulous behind the knees, and around the Achilles tendon. Pay attention to detail, and you'll be less likely to slice bits of skin off. Don't rush yourself.
When you finish, use a moisturizing lotion on your legs.