1. Keep it Dark
The biggest tip is to store beans whole in a cool, dry, dark place. If your coffee came in one of those foil bags with the one-way valves to let gas out but no air in, leave it in the bag.
2. Keep it Whole
There's a reason those specialty coffee shops grind their beans right before brewing. As soon as beans are ground, they start to lose flavor, so buy and store them whole if possible.
3. Keep Air Out
If it came in a paper bag, transfer it to an airtight container and store at room temperature, away from light. Specialty canisters that block light and air while letting the gas escape are an ideal solution.
4. Keep it at Room Temperature
Contrary to what you may have heard, you do NOT want to store your coffee in the refrigerator or freezer. Coffee will absorb odors and moisture and the oil in the beans will come to the surface, all of which affect the flavor.