Well not just glasses because people seem to think that the $5 fashion shades actually are sun glasses but they offer no protection at all I suggest investing in a good pair of sunglasses I personally got polarised because I found them to be so much better in the bright sun when driving and at the beach.
Usually by wearing sunglasses
Sun glasses help. You can wear a hat or a visor. Also don't look at the sun, or bright lights.