With that said, there are some general rules to follow and some things you should keep in mind when trying to make the perfect pairing. Number one, think of the density of the food you are eating. Is it light, like a fish, or are you eating something heavy, like steak or lamb? The common saying that I'm sure everyone has heard is to drink white with fish and red with meat. It's a good rule to follow, but you also need to think about how it's prepared.
That leads me to number 2, what types of sauces is the dish being prepared with? A grilled simply seasoned fish isn't going to be the same as a fish in a cream sauce. You might do a sauvignon blanc with the grilled fish, but a chardonnay to pair with the cream sauce. Try to take a look at the fat content in the food itself in addition to the accompaniments or how it's prepared. A nice meaty, hearty steak is going to be fattier than a piece of chicken so it will stand up better to a bolder, richer red like a cabernet sauvignon.
Alcohol is another factor that can overpower the dish if not paired correctly. Typically wines that are 14-15%+ are considered to have high alcohol, which you can usually sense in the wine because you'll feel the heat in your mouth or throat. Not paired correctly it will overpower the dish and ruin the taste of the dish. You will also get the same effects in spicy foods. If you have a dish that is spicy that creates its own heat in your mouth and now you have a high alcohol wine neither will be enjoyable. Salts are also known to do this. For example, if you are having asian foods with a slight spice you might want to try pairing it with a Gewurztraminer or a Riesling to balance it off.
If you experiment with it you will also notice in some wines that are highly tannic or that have high acidity, when paired appropriately, will smooth and round out. I recently had a Malbec Riserva that was a great wine alone, but it was so rich and full bodied that I probably could only enjoy a glass of it, but once I had paired it with my meal it had changed it's characteristics based on the pairing and now I felt I could finish the bottle (if I really wanted).
Sometimes it helps to think of the origin of where the food came from as well. When I lived in Italy many years ago someone taught me that some believe the food there was established around the wine. When you think about it, it stands true for many of the regions I've visited in Italy. For example, a pasta with sauce or “gravy” can be classically paired with a Chianti Classico or a dish with porcini mushrooms might pair well with a Barbaresco, Nebbiolo or even an Arneis due to it's earthiness and meaty consistency. This stands for a lot of the European and Old World countries that have centered their meal around the wine to complement the food.
So I may have said it's easy and after mentioning all these factors it may still be a lot to think about, but the more you experiment the easier it will get. Great harmonies can be created with the right pairing. Don't be afraid to ask for pairings at your local wine shop or shoot me an email and I'm happy to provide my insight. Have fun with it!