If you cook using wine in a marinade, soup, stew or sauce, serve the same wine when you eat the meal. What could be simpler than that? Your recipe wouldn't call for the wine if it didn't go well with the food you're cooking. Even though the alcohol in the wine will evaporate during preparation, the flavor will remain. Serving the dish with the same wine is the perfect way to make sure the food and wine combine in a pleasing way.
This means, of course, that you should cook with a good wine that you will enjoy drinking. But that's a good rule of thumb anyway. If you don't like the wine, the food you cooked with it probably won't please you either. This also means avoiding so-called cooking wines, which have salt and other additives and aren't intended for drinking.
The common wisdom on which wines to add to which foods is similar to that of which wines to drink with various dishes: Full-bodied reds go well with red meat dishes and in red sauces. Dry whites are good ingredients for seafood dishes and light cream sauces. Sherry goes well with poultry and in soups. Sweet wines are good in desserts. Add regional wines to regional dishes.
Want to be more daring? Keep reading.