This discussion comes down to freshness and convenience.
Once coffee beans have been ground the grinds start to oxidise which can dramatically alter and reduce the flavour.
Buying freshly roasted beans and grinding them yourself will give you the best tasting coffee.
Grinding your own beans enables you to tailor your grind to your preferred coffee making method. However you will need a coffee grinder!
If it is all about convenience and your aren’t picky then you can buy some drinkable coffee off the shelf in your local supermarket, however you need to look for the freshest grind. You will find a big difference between coffee which was ground a day or two ago and coffee that has been sitting on the supermarket shelf for months.
Freshly ground coffee beans make better coffee. – by this I mean coffee which is ground just before brewing.