Car dying when the lights are turned on?

Try unplugging the headlights to see if it's a load related issue. If no change, it's not the headlights themsleves, but a wiring issue. If the car runs fine, plug in each headlight alone, and see what happens. It may be in the wiring along the headlight circuit.

Could be a switch grounding out and sucking energy. Be VERY careful. This has the makings of a quickly toasted harness.