Whether you are dining in a restaurant with a glass of wine or drinking at home, being able to evaluate a wine is an essential skill for any wine drinkers. It can help you appreciate your wine much better, and often impress others.
So you are in a restaurant and the waiter/sommelier pours you the first sip of wine
A reason for tasting wine before it is served is to make sure that the wine is not "Corked". The word "Corked" means cork taint, it refers to a wine with undesirable smells/tastes. This spoilage is usually blamed on the cork stopper.
Don't worry, as it rarely happens - I have only experienced corked wine once in the past two years of eating out in restaurants.
Look at the wine label - Is it the bottle you ordered?
Sometimes waiter/sommelier can accidentally grab the wrong bottle of wine from the wine rack, so double check the wine is the one you want.
Look at the appearance - Is it clear and not cloudy?
The waiter/sommelier will uncork the bottle, pours a small glass for the person who ordered the wine for tasting. (In higher-end restaurants, some sommelier will pour a small sip of wine and taste it before letting you to taste it.) A corked wine sometimes look cloudy.
Swirl and sniff - Is it a clean smell and has no odour?
A corked wine may have an unpleasant damp, mouldy cardboard smell, this undesirable aroma is from 2,4,6-trichloroanisole and from its chemical relative 2,4,6-tribromoanisole. These chemical compounds are naturally produced inside the cork when airborne bacteria and fungi reacts with chlorinated/brominated phenol compounds.
Taste - Is it clean and has no terrible taste?
This step is optional, some people will nod to the waiter/sommelier after sniffing the wine, then the waiter/sommelier will pour around the table, returning to you glass last.
In the unlikely event that you feel the wine is not satisfactory or presentable (Corked), you have to send it back and ask for a replacement.