The first line of defense against the sun is covering up. Stay in the shade as much as possible, and avoid sun exposure during the peak intensity hours (10 a.m. to 2 p.m.). Use a hat or visor and be aware of sun reflection off sand, water, and/or cement.
For children 6 months or older, apply sunscreen at least 30 minutes before going outside, with an SPF of at least 15. (I prefer 30.) Sunscreen must be absorbed into the skin to be most effective. It will not work as well if you wait to apply it when you get to the pool or beach. In order to not miss spots, I recommend applying sunscreen while your child is naked. Sunscreen should be reapplied every two hours or after swimming or sweating.
Practical tip: For children who complain of stinging when sunscreen gets into their eyes after sweating/swimming, try one of the “face sticks” which looks like a big lipstick. In my experience, these products stay on and don’t run. (Waterbabies and Neutragena each make a face stick.)