Staying healthy and avoiding infections have never been more important. Social distancing can help keep other people's germs from landing on you, and frequent hand-washing will kill them if they do reach you. But what can you do to improve your body's ability to fight off germs if—despite your best efforts—you pick them up?

What you eat can make a big difference in how well your immune system functions. "It's really important for older people to have very nutrient-dense diets," says Katherine L. Tucker, Ph.D., director of the Center for Population Health at the University of Massachusetts Lowell. Immune responses decline with age, and many older adults have chronic low-level inflammation and underlying health conditions, like heart disease and diabetes, that can also hamper the body's defenses. And they may become less efficient at absorbing many infection-fighting vitamins and minerals.

Getting your immune system in battle-ready shape won't happen overnight. "I don't think you can suddenly change your diet today and tomorrow your immune system is happier," says Philip C. Calder, Ph.D., a professor of nutritional immunology at the University of Southampton in the United Kingdom. But shoring up your diet now can pay off in the long run with fewer sick days and better overall health.

How Immunity Works

The immune system has often been compared to a police force. Made up of an intricate network of molecules, cells, tissues, and organs, it's on patrol everywhere in the body. One part of the force, the innate immune system, is on the front lines—in skin, saliva, the GI and respiratory tracts, and elsewhere—and acts quickly to thwart foreign invaders. The other part, the adaptive (or acquired) immune system, works over days to track down bad actors that have breached the first-line defenders and helps develop antibodies against them.

More On Healthy Eating

Because the components of the immune system are so varied, keeping it healthy means getting an array of vitamins and minerals, which often work together in dozens of immune-boosting roles. Vitamin A, for example, is important for healthy skin and GI-tract cells. Vitamins C and E are antioxidants that protect cells and tissues from the flood of damaging free radicals produced when the immune system is fighting off an invader. Making new immune cells and initiating an immune response requires B vitamins (B6, B12, and folate). Other nutrients that fuel your immune system are copper, iron, magnesium, omega-3 fats, protein, selenium, vitamin D, and zinc.

The Power of Plants

The best diet for your body's defenses is one that's based on whole, minimally processed food that's mostly cooked at home. Eating too many foods high in saturated fats, sugars, and salt can weaken immunity. In addition to multiple nutrients and phytochemicals, plant-based foods also provide fiber, which feeds the healthy bacteria in your gut. These bacteria aid immunity, too, Calder says.

Fruits and vegetables supply most of the body's need for vitamins A and C, which are important germ fighters. Produce is also generally rich in antioxidants, which tamp down inflammation and protect immune (and other) cell membranes from damaging oxidation. Aim for at least 2½ cups of vegetables and 2 cups of fruit per day. Mix up the type and color of your produce to get a wide variety of nutrients. Tucker recommends having at least one green vegetable every day, such as spinach, kale, Swiss chard, broccoli, arugula, or cabbage. Bell peppers, potatoes, sweet potatoes, and carrots are also high in vitamin A and/or C. Citrus fruits are high in C, as are tomatoes, strawberries, and kiwifruit.

Nuts and seeds are great sources of crucial vitamins and minerals, fiber, protein, and healthy fats. Vitamin E is a potent antioxidant, and most people don't come close to consuming the daily need (15 mg). Tucker says munching on a handful of sunflower seeds or almonds every day will do the trick.

Almonds also provide copper and magnesium, which studies show are involved in DNA repair and antibody production. Sunflower seeds have selenium, copper, folate, and zinc. (Deficiencies of zinc account for 16 percent of lower respiratory infections across the globe.) Hazelnuts, pistachios, and walnuts are brimming with B6.

Beans and whole grains contribute nutrients and contain fiber to help replenish healthy intestinal bacteria. Lentils are a good source of copper, folate, and iron; garbanzos and black beans provide zinc; and cranberry beans are high in folate. Whole-grain breads and cereals and whole grains themselves (barley, bulgur, wheatberries, oats, and quinoa, among others) supply B vitamins, copper, iron, magnesium, and zinc.

Healthy oils, such as olive, flaxseed, and canola, supply omega-3 fats, which help keep inflammation in check and regulate immune cell activity. A tablespoon or two of an oil-based dressing can also help your body absorb antioxidant carotenoids (which the body converts to vitamin A) and other nutrients in greens and other vegetables.

Choose Healthy Meat and Dairy

"You need animal-based foods to provide the things that plants can't supply enough of," Calder says. "A good example is vitamin B12, where meat is a very good source." Some vitamins and minerals are more accessible in animal foods than in plant foods. Zinc, for example, is more readily absorbed from seafood and meat than from beans and whole grains. Adequate protein also has the building blocks for immune cells.

Meat and fish. While you don't need either on your plate at every meal—a few times a week is fine—they do supply key nutrients. Lean meat and poultry have ample B vitamins (especially vitamin B12, which about 20 percent of older adults are deficient in), iron, selenium, and zinc. Shellfish is a good source of zinc, copper, and selenium. And fatty fish like salmon, tuna, and mackerel are important sources of omega-3 fats as well as B vitamins, selenium, and vitamin D, which may protect against upper respiratory tract infections and over-responses by the immune system.

Dairy foods add to your stores of vitamin A, some Bs, zinc, magnesium, and selenium. Fortified dairy products—such as milk and yogurt—can supply hard-to-get vitamin D. Yogurt (plain is best so you avoid added sugars) is also teeming with probiotic bacteria, which help keep the intestinal microbiome healthy. In two studies involving healthy older people, one lasting more than 8 weeks and the other more than 12 weeks, those who ate about 3 ounces of yogurt daily had fewer colds than those who drank milk.

What About Supplements?

Supplements for the immune system have been flying off store shelves recently. But experts warn against using them in most cases. You run the risk of getting too much of a nutrient. Too much zinc, for example, can block copper absorption, and high levels of folate can mask a vitamin B12 deficiency. Herbal and other remedies, like elderberry tincture and colloidal silver (silver molecules suspended in liquid), which have been advertised on social media as a way to destroy the coronavirus, are unproven and potentially harmful. IP-6 (phytic acid), touted as an antioxidant, can lead to calcium, iron, and zinc deficiencies, and polyphenols from green tea extracts may reduce the absorption of iron, folate, and vitamin C.

It's best to get the nutrients you need from food so that you don't lose out on other beneficial ingredients, like phytonutrients. The exception is vitamin D. Because more than 80 percent of older Americans don't get enough from diet alone, Kathleen Tucker of the University of Massachusetts Lowell recommends taking a supplement. The daily need for people ages 51 to 70 is 600 IU; over 70, it's 800 IU.