1) Clean your gear. Whatever it is. Clean it.
2) Buy coffee with a one-way valve in the bag. If explosion isn't a risk, you don't want it. Grind your own, even just at the grocery store.
3) Use decent-tasting, fresh water
4) Aim for decent storage conditions (not on top of your fridge)
5) Find the most recently roasted beans you can
6) Nice gear
7) Nice grinder
Handle 1-4 before tackling 5-7.
<3, a former barista