The best way to prevent sunburn is to stay out of the sun. There's a higher chance of getting sunburn: