Each style of coffee brewing has its own optimal grind requirements. The three most common grind types are fine, medium, and coarse. However, one of the problems with using these terms is that without a point of reference, it's difficult to explain what coarse or fine mean.
General rules are that if your coffee tastes weak you may need to grind finer. And if the coffee tastes bitter, experiment with a slightly coarser grind.
Grinding the coffee may be the single most important act in the entire sequence of espresso brewing events. Heavy body and rich flavour of espresso coffee is achieved through pressure and resistance: pressure by the brewing water and resistance to that pressure by a uniform layer of compressed, ground coffee. The hot water, under great pressure, does its best to push its way through the layer of ground coffee, but owing to the resistance of the finely-ground and highly-compressed coffee, it cannot succeed until it has saturated every grain of the coffee, extracting the coffee's entire flavour and perfume almost instantly, and delivering it intact into the cup. This perfectly poised opposition of pressure and resistance is at the heart of the espresso brewing system.
The ideal grind for espresso is: 1) a grit just short of powder; 2) a relatively uniform grit in terms of size of grain; and 3) a grit made up of flaked or shaved, rather than torn or compressed, grains. These three criteria are listed in order of importance.
First, the proper grind overall, is crucial to any degree of success in espresso brewing. An overly coarse grind will permit the water to gush through the coffee bed and will produce a thin, bitter cup; a powdery grind will slow the brewing process to the point that only dark, burned-tasting dribbles will escape the filter holder. However, the optimum grind varies somewhat according to the nature of the brewing apparatus. Larger, more expensive pump and piston machines require a finer grind than the relatively inexpensive, steam-pressure apparatus. The greater the pressure, the finer and more compacted the coffee bed must be to take full advantage of the pressure-resistance equilibrium of the espresso method.
Second, uniform grind, also varies in importance depending on the sophistication of the brewing equipment. The greater pressure exerted by the machine, the more uniform the grind needs to be. Small steam-pressure machines will make a reasonably flavourful espresso with a relatively inconsistent grind of the kind produced by inexpensive home grinders. The larger pump and piston machines require a much more uniform grind, which can be produced only by a commercial grinder or by one of the more expensive specialized home espresso grinders.
Third, there is no doubt that a grind that is produced by shaving the bean into relatively uniform flakes is superior to a grind produced by crushing the bean or tearing it into irregular pieces. The flaked configuration absorbs water more quickly and completely than the more rounded, compressed grains produced by crushed beans, and more consistently than the irregular grains produced by tearing the beans. Flaked grains are produced by burr grinders with sharp, high-quality burrs. Torn grains are produced by inexpensive blade grinders and crushed or compressed grains either by good burr grinders with dull burrs, or by cheap burr grinders whose burrs were dull to start with. It is true that a grind that is correct and uniform, albeit compressed rather than shaved, will produce decent quality espresso, but the finest beverage will only be produced by a properly flaked grind.