1. Unless the recipe specifically calls for it (like in a dessert), use a dry wine, not a sweet one.
2. In general, use a white wine with fish, chicken and pork dishes, and a red wine with beef, but you can certainly experiment. White wine is probably more versatile for cooking than red.
3. Add wine to dishes when you want an acidic note. A little wine in a cream sauce, for example, can temper its richness.
4. Use whatever wine you have on hand. You don't need to use the same wine in the sauce as the wine that will be served at the table. Since you're cooking the wine, grape variety isn't a big deal.
5. The best features of an expensive wine disappear in the cooking, so pick a decent, but not stellar wine for cooking. Don't use a wine that you wouldn't want to drink and don't use a wine that you really want to drink.