A well-working immune system prevents germs from entering your body and kills them or limits their harm if they get in. To keep your immune system healthy, get plenty or sleep, stay active, eat healthy foods, manage your weight, reduce your stress and follow other healthful habits.