Yes, sunburns can be prevented through various measures. These include:
Using a broad-spectrum sunscreen with an SPF of at least 30. Wearing protective clothing, hats, and sunglasses. Seeking shade during peak sun hours (10 AM to 4 PM). Avoiding tanning beds. Reapplying sunscreen every two hours and after swimming or sweating.