Toyota Corolla 1997 headlights problem

My 1997 Toyota Corolla the headlights do not work when I start my car and turn the headlight switch on instantly kills my car and I checked the relay under the hood I bought a brand new one and if I take a relay out and turn the headlights on my car doesn’t die but if I leave the relay in and turn my headlights on instantly dies

There may be a problem in the main power bus area. The added current needed by the lights is causing a drop in voltage that also supplies power to the ignition area. So when the lights are turned on, the ignition voltage drops enough to kill the engine. I would first start by cleaning all the connections at the battery to see if that helps. Then check for problems with the panel under the hood if that doesn’t solve the trouble.

Doesn’t anyone screen this forum?

Don’t drive at night or when it’s raining. Problem solved.

In all seriousness, it sounds like Cougar is on the right path (his answer could be EXACTLY right). I’d be looking for damaged, corroded, or otherwise broken ground wires.