Note the diagram for headlamp. I'm talking about manual headlamps, not automatic. With intermittent issues need to do testing when problem is ongoing, voltage and ground, you can use test light to check. Any applicable trouble codes? I did see some headlamp trouble codes. These were B type codes, to check codes, at the least, you need an obd2 code reader that will work with your vehicle and read manufacturer specific codes. The headlamp switch and dimmer grounds a circuit from the bcm, letting the bcm know what your doing with head lamps. The bcm controls the hdm relay. The problem could be almost anywhere for that system? Any codes and your testing may narrow down the problem. Hopefully