Jack's got it nailed. That's why "hair of the dog" is a good hangover "cure."
Eat the greasy stuff BEFORE you drink. It'll kill the buzz but it'll stop/slow down the hangover in process.
Ask a chronic alcoholic. A lot of them never have hangovers. Just keep the blood alcohol level up at all times. It works.
Sugar, liquids and time.
Skip the ibuprofen and aspirin. They don't mix with alcohol.
You can take Xantac for an upset tummy. Some think that a fizzy, sweet drink works well. Usually because it'll deliver the sugar to your bloodstream faster.
Doesn't hurt to learn from your mistakes along with it all. Or you can just suck it up and decide that's the price you pay for fun.