A fungal stain test like KOH preparation is used to detect the presence of fungal organisms in a sample, such as skin scrapings, hair, or nail clippings. It is commonly used to diagnose fungal infections of the skin, hair, and nails, such as ringworm, athlete’s foot, and nail fungus.