Despite the pretensions of modern technology, there are still only four ways to grind coffee. The oldest is the mortar and pestle. The next oldest is the millstone, updated to steel burrs or corrugated plates. The next is the roller mill, which is used only in giant commercial grinders. The most recent is the electric blade grinder, which works on the same principle as an electric blender.
In general, grind coffee as fine as you can without clogging the holes of the brewer or turning the coffee to mud. The finer the grind, the more contact there will be between coffee and hot water, and the faster and more thoroughly the essential oils will be released, without activating harsher, less-soluble chemicals.
On the other hand, you do not want to grind your coffee to a powder, because completely pulverizing it destroys the essential oil, which is partially vaporized by the heat and friction of the grinding process. Nor do you want to clog the holes in a coffee maker or filter, or fill your cup with sediment.