The best way to prevent skin cancer caused by UV radiation is to protect your skin from the sun. Also, it is very important to protect children from an early age, since research has found that most sun damage happens before age 15.
It is best to wear sun protective clothing when exposed to the sun, and specially when swimming, and use sunscreen on exposed skin whenever you can.
Also, you should be aware of UV radiation which can be reflected by sand, water, snow, and ice. UV radiation can go through light clothing, windshields, windows, and clouds. Wear long sleeves and long pants, a hat with a wide brim, and sunglasses that absorb UV. Use sunscreen lotions (at least SPF15) where possible.