First determine that you are vitamin D deficient. Consult your doctor, who may order a blood test to determine your vitamin D level. If you're deficient, your doctor my recommend daily or seasonal vitamin D supplementation.
Some foods contain some vitamin D, but not enough to meet the daily requirement. Too much vitamin D can cause side effects, so take only what your doctor recommends. The body regulates the amount of vitamin D it makes in the sun, but cannot protect against excess vitamin D from supplements.
Dietary guidelines from The Institute of Medicine of the National Academies recommend 600 International Units (IU) of vitamin D daily for children over the age of one and for teens and adults up to age 70. For those over 70, 800 IU is recommended.