Viability stains are contradictory because the staining itself kills all the organisms, but it’s used to tell which one was dead from the get go and which one was alive. There’s two types of viability stains, Methylene Blue and Trypan Blue Exclusion.
Methylene Blue is used for yeast viability in beer, wine, alcohol. Viable (living) yeast do not stain and remain colorless; whereas non-viable, non-metabolizing cells stain blue.
Trypan blue is used on animal cells and the results are the same as MB. Since cells are very selective in the compounds that pass through the membrane, in a viable cell, trypan blue is not absorbed, or in other words, it is excluded, which is why it is sometimes called a dye exclusion method. In dead cells though, the dye passes through and appears blue under a microscope.