Get the freshest beans; roast and grind at home, if possible; brew only what you are going to drink because it is best to drink coffee withing the hour.
For the freshest possible coffee the ideal is to obtain unroasted beans, then roast and grind on the same day you plan to brew.
Roasting beans is, however, something of a 'cooking' specialty. Unless you're willing to invest in a fairly expensive piece of equipment, the results are often less than satisfactory. Not to mention that - even when done correctly - it can fill the house with odors that take time to dissipate and can become annoying.
Beans, even after roasting, will stay fresh for a while. Freshly roasted beans naturally release small amounts of carbon dioxide which helps to keep oxygen away from the bean, delaying spoilage. If stored in an airtight container, especially with a drying agent, they'll retain their good flavor and aroma for up to a week.
Naturally, the closer to roasting they're ground and consumed the fresher they'll be. But even after a few days they can still produce a stellar grind and a superior brew. After two weeks the flavor may still be acceptable, even though aroma will no longer be first rate. Whole bean coffee stored at even optimum conditions will be dull after a month.
Key to getting a good cup from purchased roasted beans is to ensure that the skin is unbroken. When that happens, all bets are off. Oils underneath the skin and inside the bean will deteriorate unless frozen, in which case the brew will never be first rate.
When storing beans, be sure to use an airtight container. A glass jar of the type used for instant tea grounds is tempting, but inadequate - there is still too much leakage around the lid. A good glass jar with a rubber seal is best. Many online vendors sell just the ticket. Be sure to store the jar in a cool, dark place since not only air, but also heat and light can contribute to spoiling beans.
Even better, but more expensive, are containers which flush air with an inert gas, then inject the coffee beans which then give off CO2, providing natural protection against spoilage. Beans stored in this way can keep their freshness for several weeks.
The next best thing to home roasting, and an option open even to those with less than stellar cooking skills is grinding at home.
Good grinders are available at moderate prices, are generally easy to use and are not difficult to clean. Many are automated to the point that with very minor experimentation, it's possible to arrive at consistently good grinds.
Since grinding necessarily breaks the bean skin the same 'oil spoilage' problem can arise if the grind isn't used within a few days. Like roasted beans, only more so, any grounds not consumed within a day should be packed in a desiccating cannister. Those cannisters contain a drying agent, usually beneath a mesh at the bottom, that keep moisture from introducing mold or excess oxygen into the grounds.
If not stored in a desiccating cannister, grounds will lose much flavor within a few hours. Oils will evaporate and, exposed to the air and moisture within the jar, the grounds will deteriorate.
For a superior cup, grind only what you intend to brew and drink everything brewed within an hour. With modern, moderate cost machines there's no longer any reason to suffer second-rate coffee.
Different brews for different views
Once upon a time there was only the lowly percolator. Coiffed housewives would sit lovingly staring at water being heated until pressure forced it up a small tube and over a basket full of grounds.
Well, it was amusing to watch even if the coffee couldn't be very good. Boiling coffee and running the liquid over grounds more than once can each produce a brew less than ideal.
Then in the 1970s, as with so many things, life changed forever. The drip method - inexpensive, quick and even an improvement in taste - came to dominate the scene. A cup of grounds thrown in a plastic container over filter paper, a few minutes of nearly boiling water dripping over the result and - voila! - coffee in a glass pot.
Later came pre-packaged 'pods' of a favorite blend, changes in materials and all sorts of controls to adjust the brew, and internal spouts that spread the water evenly over the grounds. Whether cone or flat, always near 200°F (93C°), please.
In the '90s, espresso makers became the rage, with the importation of European culture and the application of American ingenuity to lower the cost without ruining the flavor. Hot water is forced under pressure through finely ground dark roast and in a few minutes, out pours a delicious, aromatic drink.
Add steamed, frothy milk and you have a cappuccino or latte, depending on the ratio of milk to coffee. A definite improvement and the variety of espresso makers makes for delightful experiments in chemistry.
The French plunger is another device aiding the spread of European methods, anywhere open-minded coffee innovators are seeking the new. A metal rod extends through the center of a glass cylinder, where it is topped with a handle. At the other end is a filter, fitting snugly inside the container.
Put grounds into the container and pour nearly boiling hot water in. Unlike the drip method, the grounds steep until the plunger is pressed. The result is a dark, full-bodied brew served right from the device.
One of the more esoteric brew methods uses the vacuum brewer: two glass or metal bowls, one atop the other. Heat causes water to rise into the upper, similar to the percolator principle. Remove the heat and as the liquid cools slightly a partial vacuum is created, drawing the hot water through the grounds and into the lower chamber.
The process is a pleasant show at a dinner party and a wonderfully fresh cup, since it can be carried out right at the table.
Of course, none of these methods is really new - most go back centuries in one form or another. The Ibrik from Turkey may be one of the oldest. Water is heated in a brass or copper container with a long handle and a grooved tongue. Finely ground coffee is added directly to the hot water and then poured, unfiltered. Strong!
Any of these will produce a delicious cup, but all bring out distinctive aspects of the ground. Try them all! You may find that a history lesson can also be a delectable taste tour.