I've seen too many sailors with pieces of flesh carved out due to melanoma to ignore the sun's UV.
Those scars are probably from basal cell or squamous cell cancers and not melanoma. Melanoma cancers may be caused by UV exposure and maybe not as they can occur in places not exposed to UV light. The big danger with melanomas is they can metastasize and be fatal. They often start as moles and then the genes mutate and become cancerous. There may also be heredity factors that play a role.
Basal and Squamous cell cancers are more benign and are less likely to metastasize, but there is a chance that they will. These seem to be pretty clearly related to UV exposure.
Then there is Actinic Keratosis, aka, precancerous lesions. UV exposure appears to be a primary cause of AK. The preferred treatment is a blast of liquid nitrogen. Or what I refer to as a profit center for my skin doctor.
As someone who has lost track of how many times and in how many places I've been sliced and diced, not to mention frozen, I have an interest in these matters. Two aspects I find fascinating. My first bout with basal cell occurred about 20 years after leaving Hawaii where chronic UV exposure was part of life. I then went through a long dormant period until about 15 years after I bought my first sailboat. Since then it has been an annual occurrence. The second aspect is the location of the AK and basal cells and my use of sunscreen. I am much better about applying sunscreen to my face, neck and ears and less so on my legs and arms. I've had no AKs or basal cells on my arms and legs, but many on my face and forehead.
Finally, if you have a choice go to a plastic surgeon for your skin care, especially if cutting is involved. The plastic surgeons are much better at hiding the scars. My current skin doc is a plastic surgeon and when he sees the scars the dermatologist left he always makes a comment.
Except meat, dairy or refined sugar. (Doctors don’t learn nutrition in medical school, it’s not part of the curriculum, and they don’t learn about it from drug companies either.)
https://nutritionfacts.org/
I won't argue the benefits of a decent diet, however, as in most things follow the money. Ambitious nutritionists are not immune to the siren call of a dollar.