The human body has the capacity to synthesise all the vitamin D it requires from sunlight.
However, due to modern lifestyles it is very difficult to obtain sufficient exposure to sunlight for vitamin D production. This is particularly true for people who live at higher latitudes and those with darker skin.
The primary food sources of vitamin D are oily fish, dairy and liver. It is difficult to increase your vitamin D levels through diet alone, so in many cases, supplementation with vitamin D3 may be necessary.