Lens-flares are what happens when the direct sun glares into your lens.
Lens-flare can give a dreamy look. And if you leave the sun in the frame, you can sometime get a lens-flare in a star-shaped pattern, which can look kind of neat. What your “star” looks like depends on your lens and how it is physically constructed (how many “blades” etc.), The effect is exaggerated at smaller apertures, like f/22.
Lens-flares are a matter of taste. If you are JJ Abrams, you find a way to stick them into every movie you shoot. They drive other people nuts and they will do anything to keep them out.
To get it out, you have to shield your lens from the glare with your hand or a hat. This is easy to do with a tripod and cable release. You just set up your composition and with your cable-release in your hand, move in front of your lens and hold your hand so that it barely casts a shadow over your entire lens. But if the sun is actually in your composition, there is not much you can do.
Personally, I like lens-flare and the look for a lot of images, but sometimes it just makes an image look foggy. I usually try to shoot it both ways and choose which look I like the best later in Lightroom.
While in Big Bend, I ran into a really tricky backlight situation where the backlit wildflowers were beautiful but I had to include the sun behind the Chisos Mountains if I wanted to show the big landscape. So we are talking lots of lens-flare, huge contrast ranges, etc. So I shot this image at small apertures and tried to get as much flare and rays into the frame as possible. Why fight it?
Canon 1Dx. 23mm. ISO 1000. f/22 @ 1/640 second. EV -1. Polarizer and 3 Stop Graduated neutral density filter.
Canon 1Dx. 35mm. ISO 1000. f/16 @ 1/500 second. EV -2. Polarizer and 3 Stop Graduated neutral density filter.