How can I avoid sunburn?

Monitor the UV Index of your local area, and follow the advise to apply sunscreen when the index is high, and reapply according to the label of your sunscreen.  SPF 30 should be sufficient for most areas.