Sun glare can ruin even the most pristine of pictures. Dawn and dusk are the best times of day to take photographs since the sun is not as strong. Cloudy days also produce exceptionally clear pictures since the sunlight that filters down is diffused. Generally, it is best to take pictures when the sun is not directly overhead. When the sun is overhead, the light hits the ground and then bounces back up, which causes glare.
Sometimes though, you want to capture a moment regardless of the outdoor lighting. If you take a picture of someone during the hours of brightest sunlight, try to position that individual in the shade. This will prevent shadows from falling across the face of the individual, reduce the likelihood of the person squinting, and reduce glare. All of this contributes to both you and the subject feeling more relaxed, which produces a better quality photograph.
Another way to reduce sun glare is to use a UV filter to protect your camera lens and absorb UV light. Sun glare often presents itself in pictures as excessive blue light and these filters reduce its appearance. They are available in different absorption levels and they also protect your camera lens from dust, moisture, fingerprints, scratches, and other damages.