Follow directions at first. Neophytes should start with recipes from a good cookbook, and until you get the knack, instructions should be followed to the letter. This also holds true for preparing packaged foods. Soon you'll be able to eyeball measurements without ruining the dish, and to tell when it's done without being a slave to the timer on your stove.
Practise beforehand. Dishes become easier the more you prepare them, and if you're cooking for company, it's better to make something you've tried before. On the other hand, don't be afraid to try a new recipe on a forgiving friend. You'll get valuable feedback, and maybe even some help cleaning up.
In a pinch, improvise. This goes both for ingredients and utensils: pour a little salsa on that meatloaf before you throw it in the oven, or drizzle a some pasta sauce on those nachos. Why not? And if you're short on frying pans, you can cook those pork chops just as well on the bottom of a large pot, even if it does make you feel a bit silly.
Make it yourself. Just about any food can be made at home from scratch, so don't feel obligated to prepare canned soups or ready-made entrées all the time. Adventurous types who make more things themselves are rewarded with meals that are healthier, better-tasting, and often less expensive. Not only that, they score extra bonus points with dinner guests: "You baked this bread? Wow..."
Be efficient. When you're cooking, use your time as well as you can. While you wait for the main dish to cook in the oven, prepare a side dish on the stovetop, or tidy up the mess you left on the counter. This saves time while you're cooking and cuts down on cleaning afterward. If you need to add more ingredients later, get them ready in advance—just like they do on cooking shows. Managing your time makes complicated recipes easier, and makes you feel like a pro.
Vigilance is vital. There is no substitute for watching your work. Leaving your cooking alone for too long makes for a mediocre meal at best, and can be disastrous when timing is crucial to a dish. And don't just keep an eye on the food, but taste it regularly, if possible—it'll help you catch mistakes in seasoning before it's too late to do anything about them.
Presentation counts. Not only does a little extra effort help food look appetizing, but appearance can make or break an otherwise well-cooked meal. Arrange the food neatly on the plate. Or try layering: serve meats or stews over rice, for example. Pour on a sauce, or add a garnish if you're so inclined. You'll be amazed at how much better that leftover potato salad looks if it's spooned over a fresh lettuce leaf.
In short, the secret to good cooking is forethought, attention, and practice. With a dollop of perseverance and a dash of imagination, you'll be able to whip up just about anything. Cook often for yourself, and you'll save money and eat healthier; cook for someone else, and she'll be even more impressed than if you took her out. And you won't have to invite her back to your place—you'll already be there.