I had intermittent headlights (none, most of the time). Took out the dimmer switch and cleaned the crud and rust from around the terminals, cleaned the plug. Checked the dimmer switch with an ohm meter. Headlights still only came on when they felt like it.
Did a voltage trace and ohm check on the headlight switch. That checked out fine. Cleaned the firewall connector. No difference.
Finally, had to remove the headlight buckets and re-do the grounds behind the headlights.
Bingo! Headlights working!