By Georgia Hartmann.
Deficiency in vitamin D, a fat-soluble vitamin, is estimated to affect more than one billion people worldwide. As 50-90% of vitamin D is absorbed through the skin via sunlight, the problem we face is that many people do not spend sufficient amounts of time in direct sunlight. 
Vitamin D for Immune Function
While vitamin D was first recognised for its role in bone mineralisation and calcium regulation (rickets is a bone disease characterised by vitamin D deficiency), more recently it is known to exert many extra-skeletal effects including modulating the immune system. 
Vitamin D has numerous effects on cells within the immune system. It inhibits the proliferation of particular immune cells一B cells, which produce antibodies, and T cells which (when unbalanced) promote inflammation. Ultimately, this results in decreased production of inflammatory proteins (called cytokines).  Because of this positive impact, vitamin D is commonly investigated and used in the management of autoimmune diseases including type 1 diabetes, multiple sclerosis, inflammatory bowel disease, systemic lupus erythematosus, and rheumatoid arthritis. 
Vitamin D for Thyroid Disorders
Vitamin D has also been studied for its beneficial role in improving thyroid disorders, including hypothyroidism and autoimmune thyroid disorders including Hashimoto’s.  In fact, one case-control study found vitamin D deficiency in 92% of patients with Hashimoto's disease. Supplementation with vitamin D has also been shown to reduce thyroid antibodies in Hashimoto’s disease, namely thyroid peroxidase antibodies. [6, 7] A recent randomized-control trial found that hypothyroid patients who supplemented with vitamin D for 12 weeks improved their Thyroid Stimulating Hormone (TSH) and calcium concentrations, overall improving thyroid function. 
Vitamin D & Sunlight
Unlike other essential vitamins that are obtained from food, vitamin D is absorbed mostly from sunlight exposure to the skin. Though, the presence of clothing, excess body fat, sunscreen, and the skin pigment melanin each affect how well vitamin D is absorbed. 
Here is a general guide on vitamin D absorption, depending on your skin type: 
- If caucasian, a half-hour in the summer sun in a bathing suit can initiate the release of 50,000 IU vitamin D into the circulation within 24 hours of exposure.
- If tanned, a half-hour in the summer sun in a bathing suit can initiate the release of 20,000–30,000 IU vitamin D into the circulation within 24 hours of exposure.
- If dark-skinned, a half-hour in the summer sun in a bathing suit can initiate the release of 8,000–10,000 IU vitamin D into the circulation within 24 hours of exposure.
References:  Sizar, O., et al. Vitamin D Deficiency. StatPearls, 2020. PMID: 30335299.  Harrison, S.R., et al. Vitamin D, Autoimmune Disease and Rheumatoid Arthritis. Calcified Tissue International, 2020. 106(1). PMID: 31286174.  Aranow, C. Vitamin D and the Immune System. Journal of Investigative Medicine, 2011. 59(6). PMID: 21527855.  Kim, D. Low vitamin D status is associated with hypothyroid Hashimoto's thyroiditis. Hormones, 2016. 15(3). PMID: 27394703.  Tamer, G. Relative vitamin D insufficiency in Hashimoto's thyroiditis. Thyroid, 2011. 21(8). PMID: 21751884.  Koehler, V.F., et al. Vitamin D Status and Thyroid Autoantibodies in Autoimmune Thyroiditis. Hormone and Metabolic Research, 2019. 51(12). PMID: 31766063.  Chao, G., et al. Correlation Between Hashimoto's Thyroiditis-Related Thyroid Hormone Levels and 25-Hydroxyvitamin D. Frontiers in Endocrinology, 2020.PMID: 32117049.  Talaei, A., et al. The Effects of Vitamin D Supplementation on Thyroid Function in Hypothyroid Patients: A Randomized, Double-blind, Placebo-controlled Trial. Indian Journal of Endocrinology, 2018. 22(5). PMID: 30294564.  Mead, M.N. Benefits of Sunlight: A Bright Spot for Human Health. Environmental Health Perspectives, 2008. 116(4). PMID: 18414615.