You can usually grind coffee where you buy it. However, it will stay fresher in whole bean form. It is best to grind the coffee right before you brew it.
If you have a blade grinder it’s best to shake the grinder while grinding, and tilt it. The idea here is to get as close to a uniform grind as possible. This is possible to approximate but impossible to actually pull off since blade grinders slice the beans and inevitably will leave you with grounds that are inconsistent, mixed with coarse and fine.
The better grinder is a burr grinder. This allows for a more consistent grind. But how fine should you grind? You will want a slightly coarse medium grind for french press, a medium fine for pouring fresh drip, a fine for auto drip (if you use a filter) and very fine for espresso.
The best way to find if you are getting a proper extraction is to weigh the coffee before, then afterwards dry out the grounds and weigh them again. In a proper extraction, the grounds should weigh 19% less. If its weight loss is more than 19% then it was over extracted and needs a coarser grind; if its weight loss is less than 19% then it was under extracted and needs a finer grind. If you use 2.5 oz of coffee per pot, (.156 pound) then after brewing and drying the grounds they should weigh 2.025 oz (.126 pound), any more and the coffee is over extracted and your grind is too fine, any less and your coffee under extracted and your grind is too coarse. The same can be done for espresso. A Standard Coffee measure is about .33 oz (.02 pound) after drying it should be .27 oz (.016 pound)
If you don’t have a scale that is that accurate you can time your espresso shot. If it takes less than 20 seconds it is likely under extracted and too coarse. If it is over 30 seconds it is over extracted and too fine.
My experience with grinders has been that the Cuisinart is good for auto-drip but not able to grind fine enough for espresso and turkish/greek coffee. Braun has a burr grinder (model 4045) that can grind fine enough for espresso.
I will add grinders to this list as I test them.