Like everything else in life, "moderation in all things" is the best rule to follow. If you spend your life getting deep dark tans or don't take sensible precautions against sunburns, expect melanoma. If you avoid sunlight like a cave dweller, expect deficiencies in everything from vitamins to mental health.