Although you may not think about your immune system until you feel like you’re getting sick, it is always working hard to keep you healthy and alive. Potential environmental threats include viruses, bacteria, fungi, and chemicals, among others. The course and outcome of an infection depend on the characteristics of the pathogen and the circumstances of the host.

Viruses, for example, are responsible for a wide array of diseases. Some, like colds and influenzas, can usually be fought off by your immune system within a matter of days to weeks. Other viruses, like human immunodeficiency virus (HIV), have mechanisms to evade the immune system and thus wreak havoc on the body and usually necessitate lifelong medication to manage symptoms.

There are four main pillars that contribute to a healthy immune system; physical barriers, ability to recognize self, innate immunity, and acquired immunity. The skin and mucous membranes provide the physical barrier that is your body’s first line of protection. Next, it is important that the immune system differentiates between its own cells and foreign cells so that it knows which ones to attack. Failure to recognize cells as self can result in autoimmune diseases such as rheumatoid arthritis, type 1 diabetes, celiac disease, or psoriasis.

Once a virus is past the physical barriers and is recognized as an intruder the innate immune system kicks in. Innate immunity is coded in your DNA so the cells are pre-programmed to launch a nonspecific attack on pathogens right away. This involves increased blood flow to the area, phagocytosis, and inflammation. Neutrophils and macrophages are part of this response. They secrete substances to kill the invader and then engulf and digest it in a process called phagocytosis. While the innate immune cells are doing this they signal the acquired immune system to get involved.

Acquired immunity, also called adaptive immunity, learns from each invader it encounters so that it is better prepared in the future. It sends lymphocytes, such as B and T cells, to help control the infection. After macrophages engulf a pathogen, they become antigen-presenting cells, and signal B and T cells to create an antibody specific to that antigen. Antigens are molecules on the surface of pathogens that can be used to identify them. Once bound to an antigen, antibodies signal the immune system to get rid of the pathogen by attracting killer cells, phagocytic cells, or immune cells with other functions. Vaccines are inactive pathogens that give your immune system a chance to be introduced to a less threatening version of the pathogen, develop antibodies for it, and be equipped to recognize and fight off the active pathogen in the future.

What happens if a virus gets into your cells? Let’s continue with our flu example. The influenza virus infects the respiratory tract by binding to cells, entering them, and then injecting its own genetic material into their nucleus so the host cells replicate the virus. Cytotoxic lymphocytes, such as natural killer (NK) cells and cytotoxic T cells will recognize an infected cell and kill it. Symptoms that you experience are a result of different immune cells taking action. Phlegm and pus are collections of white blood cells and the debris of cells they’ve killed. In the case of fever, pyrogenic cytokines trigger the hypothalamus to raise the temperature of the body to help kill the virus.

White blood cells, also called leukocytes, are the broad category of cells in the immune system. Five main types of white blood cells commonly measured in routine blood tests are neutrophils, lymphocytes, monocytes (which mature to macrophages), basophils, and eosinophils. Checking these levels can give your doctor an idea of what your immune system might be trying to combat.

While the immune system operates without conscious effort, there are ways that you can support it. Proper nutrition, exercise, and sleep have been shown to be important for immune function. Studies suggest that vitamins A, C, D, E, B2, B6, and B12, folic acid, iron, selenium, and zinc are essential micronutrients, and deficiencies may predispose you to infection. These vitamins and minerals can all be found in a balanced diet, which will support a healthy immune system.