The best tasting coffee will always be from freshly ground coffee beans. As soon as you grind coffee, it begins to lose it aromas and flavonoids. Most experts will tell you that after 15 minutes you have lost a significant amount of both, and the taste begins to degrade quickly after that.
The easiest way to ensure that your coffee tastes fresh is to brew your coffee immediately after grinding, and the easiest way to achieve this is with a "grind and brew" coffee making system. Some systems grind directly into a filter and begin the process of coffee brewing through a drip maker. Others are espresso machines with a built-in grinder. Either way, purchasing a quality grind and brew system will put you ahead when you want to make the perfect cup of coffee.