Headlights go out when I switch to brights

When you step on the floor switch, it toggles a relay that directs the power either to the high beams or the low beams. That relay has most likely failed. If it still clicks, you may be able to locate it by following the sound when you press the dimmer button on the floor. If the relay no longer clicks, good luck finding it. Some really old mechanic may know where it is.

Another thing that sometimes happens is that the plug on the relay gets corroded and it overheats and melts.