I have a 05 Mustang base V6 auto. Headlights won't stay on. Sometimes high beam works. Everyday it's different. Last night when the fans turned on the lights would come on the off again when the fans turned off. Today I can't get them to stay on more than 2 seconds while the car is running. If the car is off they will stay on as long as you need them to. I've checked fuses and wiring. And replaced the headlight switch. While the car is running, if you turn the headlights on they will stay on for a couple of seconds then go off, turn the headlight switch off then back on they'll come back on for a couple of seconds. Also, occasionally the windows won't work, interior light and the car won't shift out of park (does this all at once) I don't know if the problem is all one thing or not. Any ideas trying to avoid the dealer.
Might be a possible alternator failure. You can check the battery voltage. It should be ~12V when not working and ~14ish on idle. This kind of faulty alternator causes something like that.
First, remove the illegal, substandard, and defective "aftermarket halo headlights" and the ballasts that came with them, and replace with the OEM lights.
Then repair the damage the ballasts did to the rest of your system when they back-fed your wiring harness with high voltage discharges.