Buy your beans green, from a supplier who knows their shit.
Roast beans yourself, fresh, and not for too long.
Consume within 1 week of roasting.
Grind beans yourself, properly, and seconds before brewing.
Brew using a method that doesn't suck, e.g., Aeropress, Bialetti Moka, real espresso machine, or siphon.
Brew using filtered water, and at a temperature below boiling where possible.
ANY deviation from the above steps leads to a direct and noticeable degradation of the coffee's flavor.
Follow those steps correctly, however, and you'll have the cheapest, best tasting cup of real coffee money can buy. And you'll quite probably start skipping the milk and sugar.
Why yes, I am a snob and a judgmental scumbag. I'm also right. You are wrong. Have a nice day.