People can protect their skin from the sun by following the tips on NCI's Sunlight risk factor page. The best way to prevent melanoma is to limit exposure to sunlight. Having a suntan or sunburn means that the skin has been damaged by the sun, and continued tanning or burning increases the risk of developing melanoma.