Sample materials that are not electrically conductive in and of themselves must be coated in order to prevent "charging". If an object charges in the electron beam, its image will disappear from view since there is no electron scatter which is what is required for image formation. Sometimes small flecks of sample will "fly away" off the sample stud due to strong like-charge repulsion.
The choice of coating often is determined by whether an EDS chemical analysis is desired. If it is, it is best to use carbon since it is a light element and its appearance will not mask the response of the heavier elements. Gold, on the other hand, will prevent lighter elements than itself from being successfully detected.