Isolation is necessary when a patient is diagnosed with a communicable disease that can be transmitted to others through contact, droplets, or airborne particles. It is also used for patients with compromised immune systems to protect them from potential infections. Healthcare providers use guidelines from organizations like the CDC to determine when and what type of isolation is required.