Decanting wine is the process of pouring the wine from its original bottle into another container. That could be any carafe, a fancy crystal decanter, or even a mason jar if you're down-home country. But what is the purpose of this?
Far back in history, decanting wine was a method of pouring only the clear wine out, leaving the naturally-occurring sediment behind in the bottle. This was an issue because wine was sold unfiltered. You might still encounter the occasional unfiltered bottle, for instance in the case of full-body reds that are aged more than ten years, or in vintage ports that have some sediment as a natural side effect.
The second purpose, which remains relevant today, is to let the wine breathe. Now, too much oxygen is bad for wine; there's a reason so much care is taken with sealing the bottle. But a little air exposure helps to soften and mellow the flavor. This is especially the case with high-tannin wines and heavy wines. Decanting doesn't do as much for delicate reds like Pinot Noir, or zesty whites like Riesling or Sauvignon Blanc, but it does benefit fuller bodied reds and whites, especially those with oaky tones.
In short, you should consider decanting for: Cabernet Sauvignons, Zinfandels, Barolos, Bordeauxs, Chardonnays, and Shiraz. It serves much the same function as swirling the wine around in a glass does; it opens up the wine and allows it to attain its peak potential taste and nose.
Start about half an hour before you will be enjoying the wine. open the bottle and pour it into your chosen vessel. You don't have to pour it a certain way or anything, this is just regular pouring. Stop every few ounces and take a test: pour just a swallow into a glass and taste it. You should be able to tell the difference between the first sip and the last, by which time you've poured all of the bottle.
Another factor at play here is the alcohol; alcohol has weight. Weighing more than other liquids, more alcohol tends to sink to the bottom. This isn't to say that the wine separates, but simply that the majority of alcohol in wine will tend to settle more in the bottom. Decanting also ensures that the whole wine is even throughout. Very much the same physics are at play here as in layered cocktail drinks, which work because different liquors have different densities.
If you're pouring off a bottle with sediment, the process is a little trickier. First, you should have always stored the bottle on its side, which prevents the cork from drying out and oxidizing the wine. A full day before you intend to open the wine, stand the bottle on its end to allow the sediment to go to the bottom. Now as you pour into the decanter, go slowly and deliberately - do not stop, or you'll mix the sediment into the rest of the wine. Keep pouring until you see sediment come up the side of the bottle's neck, then throw the rest away.
Some wines are a matter of taste. So decanting the wine is the kind of thing you only do if you're really into wine. Any bottle you buy off the shelf at the store is both too filtered to have sediment and too young to be worth the bother of breathing it, so you probably don't want to bother. But if you're the kind to buy wines up to six months in advance of opening them, you're definitely in decanter territory there!