The test involves staining a sample of pus with crystal violet and iodine, followed by decolorization with alcohol and counterstaining with safranin. This helps to identify the type of bacteria present, which can be either Gram-positive or Gram-negative.