The osmotic fragility test is used to diagnose different types of anemia by examining how red blood cells react in solutions of different tonicity. Red blood cells will swell and rupture in hypotonic solutions like distilled water due to excess water entering the cell. They will shrink and rupture in hypertonic solutions with high salt content due to water leaving the cell. In a normal saline solution that is isotonic, the red blood cells will remain intact. The test involves adding blood to solutions of varying tonicity, then centrifuging and observing if the fluid portion becomes colored, indicating red blood cell rupture.