Avoid them in the first place. Unless you are gathering nettles for culinary or medicinal uses, learn how to recognize stinging nettles so you can stay away from them. (See the Resources section for an identification guide.)
Wear thick gardening gloves when working around stinging nettles. Make sure your legs and arms are also covered. Use a hoe or shovel to dig out a patch of nettles that have become bothersome.
Treat a sting first with cold, clean water. Rinse the affected area thoroughly. If using a towel, be careful not to rub too hard, as you might push the bristles further into your skin or spread them to other parts of your body.
Apply an anti-inflammatory cream like hydrocortisone to the sting. Hydrocortisone can also help relieve any itching, as can topical creams containing antihistamines, such as Benedryl. Analgesic tablets may also help temper any pain.
Consider trying folk medicine remedies if stung. According to Jeff Day, author of "Don't Touch That! The Book of Gross, Poisonous, and Downright Icky Plants," a paste of baking soda and water can help alleviate pain from a nettle sting. Other remedies include aloe vera, jewelweed, mud, and saliva.
Look for a dock plant near the area you were stung. Dock plants typically grow low to the ground near nettle plants and are an age-old remedy for nettle stings. The plant is recognizable by its thick stem and large leaves. (See the Resources section for an identification guide.) Snap off a leaf with its stem and chew on the end of the stem or rub it between your fingers to soften and break it open. Then rub its juice on your sting.