hi Ive had some experience with this.
its like what was said before a bad earth or the connections to your head lamps on both sides are bad and need cleaning or connections need refreshing if the loom is old the wiring i have found tends to break quite easily the earths at both ends would be best made fresh and keep them separate from other earths connected to the same place make a fresh connection
hope this helps