Lets be honest — the world of the oenophile is a frightening one to an outsider. When it comes to that holy grail of consumption, the wine/food pairing, this seems to especially ring true. High-end restaurants make a killing with tasting menus accompanied by a specifically paired wine list (for only $90 extra!), but this isn't necessarily beyond the reach of hoi polli.
Not that I'm a wine snob; in fact it's the opposite. I'm not a master vintner; I've yet to meet a rioja I didn't like and I don't spend more than $20 on a bottle of wine unless I'm in a restaurant, but there are some simple rules you can follow for cooking with wine.
First: As I mentioned above, if you can't drink a glass of it by itself, you shouldn't cook with it.
Second: The stronger the flavor when you start, the more that flavor will come through when you're finished. Since heat will boil off most of the alcohol and a bit of the water, you'll be concentrating flavors when you cook with wine. If there's a huge oak flavor out of the bottle, the more you cook it, the more oak you'll taste.
Third: This goes true for any alcohol you cook with, always add it off the heat. When the wine hits the hot pan, the alcohol can atomize and if you're cooking over a flame at the time, there's a chance it can ignite. Sometimes you want this effect (flambe), but it's something you should always do on purpose in a controlled manner.
Fourth: I'm a believer in the concept of terrior – the concept that foods from the same region will taste better together than mixing foods from disparate regions. Say you're making the classic French dish Coq a Vin. You're going to want to use a good French red wine with this; an Australian Shiraz would just be out of place.
Now that we've got some basic rules down, it's pretty much free game. Since tastes are all personal it's hard to define a fast set of rules as to what sort of wine you should use when you're cooking a certain type of food, so your best bet is image a wine as a set of flavors and think about how they compare and work with the food you're cooking. Lets say you're cooking with lamb. Think about the flavors and cuisines you most frequently associate with lamb: dried cherries, apricots, raisins, mint, rosemary, garlic, fennel, and mint all immediately spring to mind, as do North African, Italian/Sicilian, Israeli, and New American (I'm gonna go out on a limb and group New Zealand and Australian in here) cuisines. When I think of wines from these regions I immediately come to Shiraz/Syrah, Malbec and Pinot Noir. Each of these wines goes pleasantly with lamb and depending on what else you're serving with with it, you'd want to choose characteristics that will compliment the final dish. Cooking with lamb and cherries? A decent Malbec would be perfect.
One of my favorite things to make is a simple braised lamb in the style of Morocco. Take a pound of lamb stew or shoulder, cut in 1″ cubes, season it with salt and pepper, and brown it in olive oil in a large cast iron. When it's well browned, remove from the pot and add two diced, peeled carrots, a medium onion, diced, and a medium fennel bulb diced. Caramelize these vegetables over high heat — when they've got some color, deglaze the pan with a half bottle of a nice Malbec. Reduce the liquid by half and add the lamb back in. Add 2 bay leaves, 1/2 cup of chopped dried cherries, 1/2 cup of dried chopped apricots, 1/2 cup of rinsed pitted black olives, and a half cup of whole, unsalted almonds. Place in a 250 degree oven for 2 hours, stirring every 10-15 minutes. Serve over couscous or rice.