Odds are it's just a dirty/corroded plug or ground connection at the headlight itself. Unplug the wiring plug attached to the rear of the headlight & then reseat it which will likely cure it. If that doesn't do it, find the black wire from the headlight plug attached to a screw going into the body. That is the ground wire. Loosen the screw that holds it to the tub, clean, & then retighten it.