Bad head light switch, corroded connector terminal, broken feed wire. Broken ground wire.
Do the front running lights work? If they do, you know the switch is okay. If they don't, there's no need to look at the feed wire to the rear lights or the rear ground wire. See how much you can narrow it down when you provide more details? You may need to trace the wiring with a voltmeter or test light. The additional symptoms and observations will determine where to start. It's can also be helpful to know if the dash lights work.