when I turn my headlights on, all my lights work but my headlights. on 1998 Mazda B4000

could it be the switch even when the other lights work?

2 answers
check to see if your getting power to the headlights
Check your fuses as well.