Vitamin D isn’t actually a vitamin or nutrient; it is a hormone produced from a photolytic reaction with ultraviolet (UV) light.
Many of us live in more northern latitudes (pretty much anywhere north of Florida), where ample sunlight is not available year round. Even for those who do have access to it, many folks spend the majority of time indoors or slather on sunscreen when they do go out. That means you probably need to get vitamin D from your diet.
As a medical doctor, I prefer patients get nutrition from food whenever possible, but vitamin D presents some obstacles. Food sources are minimal, which is why dairy and other food products are fortified with vitamin D. Some plants contain small amounts of the non-biologically active form of vitamin D, such as fungi-yeast, molds, and mushrooms. The best animal sources are liver, especially from cod, herring, and sardines. Still, unless you’re eating 30 ounces of wild salmon a day or downing 10 tablespoons of cod liver oil a day (which you're probably not!), I recommend patients supplement with vitamin D to get optimal amounts.