What does Vitamin D do and how do I know if I am getting enough? Experts weigh in.

During the pandemic, many people started extolling the benefits of various vitamins, claiming they could help with immunity or even protect against respiratory infection.

Though a highly touted study regarding vitamin D's impact on COVID-19, which went viral, was missing some much needed context, there are certainly upsides to taking vitamin D, and they go beyond boosting one's immune system.

Vitamin D is a fat-soluble nutrient our bodies need for building and maintaining healthy bones and serves many other important health functions. It is naturally present in some foods and added to others. Our bodies also make vitamin D when in direct sunlight by converting a chemical in our skin into an active form of the nutrient.

Here's everything you need to know about the impact of vitamin D.

What does vitamin D do for the body?

The primary benefit of vitamin D is helping one's body absorb the calcium that's so critical in maintaining strong bones; but vitamin D also aids one's immune, muscle and nervous systems. "Vitamin D plays many important roles, including supporting immunity, controlling glucose metabolism, and reducing dementia and cancer risk," says Walter Willett, MD, professor of epidemiology and nutrition at Harvard T. H. Chan School of Public Health.

Who should take vitamin D? The risks of a deficiency explained.

A lack of vitamin D, especially in children, "can lead to bone deformities including a condition called rickets," Willett explains. Luckily, the fortification of vitamin D in milk has improved matters on that front considerably.

And while vitamin D is important for everyone, the nutrient is "especially crucial for athletes and those in contact sports as it supports the strength of our structural bodies," says Uma Naidoo, MD, director of nutritional and lifestyle psychiatry at Massachusetts General Hospital and the author of “This is Your Brain on Food."

Vitamin D is also important in helping one's mental health. "In the brain, vitamin D acts as a neuro-steroid and plays a role in protecting against anxiety disorders," Naidoo says. "Vitamin D also promotes the growth of healthy gut bacteria which has been associated with reduced symptoms of depression and schizophrenia."

How much vitamin D per day does a person need?

The amount of vitamin D needed daily depends on one's age, but The National Institute of Health recommends 15 micrograms of Vitamin D a day for everyone ages 1-70, and for people 71 years and older to get 20 micrograms of the nutrient per day.

Sometimes there are other factors to consider. "How much vitamin D we need for optimal health and who benefits by taking supplements has been widely debated," Willett explains. "People with darker skin tend to have lower blood levels of vitamin D because the extra melanin, which generally keeps skin healthier, can reduce the production of vitamin D by ultraviolet light from the sun." As such, he says that "about 60% of African Americans and 20% of European American" have lower blood levels of vitamin D than they need, which puts them at additional risk for some adverse health conditions. The good news is that "vitamin D supplement prevents seriously low blood levels in most people," he says.

What foods have vitamin D?

High amounts of vitamin D aren't naturally found in many foods, but it is sometimes added to fortify milk, cereals, and some yogurts and cheeses. The nutrient also exists in mushrooms, egg yolks, and fatty fish such as salmon, tuna and sardines. "Almost no one gets nationally recommended amounts of vitamin D from their diet because few foods contain appreciable amounts," says Naidoo.

Instead, "most people get the majority of their vitamin D from sunlight," Willett explains. During warm weather, researchers have found that most people are naturally exposed to enough sunlight to get as much vitamin D as a body needs. Anywhere between 5 and 30 minutes of exposure each day can provide ample vitamin D, but caution should be exercised because extended exposure to sunlight can lead to skin cancer.

Another common and sometimes safer source of vitamin D is dietary supplementation. Vitamin D3 is one common supplement that many people use, and most multivitamins contain daily minimums of vitamin D as well.

"An inexpensive multiple vitamin/multimineral supplement can provide a useful nutritional safety net against vitamin D deficiency," Willett says. "As usual, sharing use of any supplements with your doctor is good practice."

Interested in learning more about vitamins? Read this next:

Is vitamin water actually good for you? It's complicated, experts say.

Are common multivitamins worth the money? New study explores the benefits, harms.

More: Are your vitamins causing climate change?

Kourtney Kardashian is selling gummies for vaginal health. Experts are rolling their eyes.

What is the healthiest milk to drink? Types and what is best for weight loss.

This article originally appeared on USA TODAY: Vitamin D or Vitamin D3 deficiency? Here's what you should know.