The grind should be fine enough and even enough that there aren’t any chunks of coffee left and the coffee seems to clump together on its own. If there are visible flakes (the lighter flakes are bits of the left over chaff or papery shell of the roasted bean) the grind should be finer. The best way to find the correct grind is to take into account how the shot pulls (the length of time) and well as how the grinds stay packed (they should not be a wet damp mess when they’re tapped out of the portafilter).
The grind needs to be pressed with 30 pounds of pressure. Brush away any extra grinds.
There should be no “mud” in the finished shot. The crema will appear a creamy white at the top of the shot as it is poured. You will be able to see it filtering up through the espresso as it settles.
One ounce of grinds equals one ounce of espresso. Try to get this as close as possible (within a few milliliters). If the shot is too large the grind is probably not fine enough. If the shot is too small and takes too long (past the time recommended for your espresso machine) the grind is too fine. Adjust the grind by as small increments as possible.
Proper grind, packing, and pulled shot will result in grinds that come out in one or two pieces as finely packed as what you see here. It will look damp or nearly dry but still wet. If it comes out too loose, with visible wetness, it is probably too coarse. If it is too tightly packed there will be lighter parts where the water didn’t penetrate–assuming your machine is working correctly.