Sunlight is a natural source of vitamin D, which is essential for bone health, immune function, and mood regulation. Lack of adequate sun exposure can lead to vitamin D deficiency, resulting in conditions such as rickets in children and osteomalacia or osteoporosis in adults.