Headlights come and go

Both headlights use 1 ground screw at the radiator support behind the grille. Exercising the switch wouldn't have any effect on that though.
More likely culprit is thermal protection inside the switch. Replace the switch.