Halogens take more power than old worn headlight switches can handle, so their internal circuit breakers trip on and off. Two things to do: replace the headlight switch, and see if that helps and if not, install a relay switch that uses the signals from the headlight switch to activate power to the headlights directly from the battery (fused).