The simplest and most common type of microscopy is done with a compound microscope. A specimen is prepared on a microscope slide, placed on the stage and viewed under magnification. An unstained cell is very difficult to see even when using a light microscope at high magnification. Certain types of microscopy, like phase contrast microscopy help in this regard but the easiest way to see cells is to stain them. Different staining methods can be used to tell differences between two cells or to stain a specific cellular structure. The staining process results in the death of the organism however so it's not always the most suitable method to use.
If a light microscope is all that's available, a simple stain can be used to see the cells on a microscope slide. These stains contain a color bearing ion called a Chromophore. The color bearing ions can react to the membrane of a bacterial cell on one of two ways. It can either be attracted to the cell or repelled by the charges found in the membrane. Bacteria tend to have a slight negative charge on their membrane. Depending on the structure of the dye this may or may not attract a stain molecule.
In Basic Dyes, the chromophore has a positive charge, Thus it's called a positive stain. Since opposites attract, (in chemistry anyways) the positively charged stain is attracted to the negatively charged cellular membrane. The cell then acquires the color of the attracted dye.
Acidic Dyes react differently since they have a chromophore with a negative charge. The negatively charged dye is not attracted to the negatively charged membrane. Therefore the cell does not acquire the dye color. So what good is a dye that "doesn't work"? Acidic dyes like Nigrosin may not stain the cell but they do stain the surrounding area. In negative staining then, the cells is visible as a light object on a dark background so it's easily seen.
Many different stains and staining protocols can be used to colorize specimens and even gain information. Bacteria, for example, can be stained by the Gram Stain procedure to differentiate cells. Depending on the uptake and capture of a dye bacterial cells can quickly be identified as belonging to one of two groups; Gram positive or Gram negative. The simplest way to stain a cell is to use a basic dye that adheres to the cell surface. Most stains are of this type including Crystal Violet, Methylene Blue, Malachite Green and so on.