Headlights randomly shut off while driving?

So I have a 2004 Dodge Ram 1500 and as of recently while I’m driving at night the headlights will turn off while I’m driving. The weird part is if I kick the panel right below the steering wheel they will turn back on. It also turns off the arrows on my dash for the blinkers (blinkers still work just doesn’t show they’re on on the dash). I assumed this was a multi-function switch or a ground wire shorting but there were also a few other things I thought it could be so I wanted to get yalls opinion before I start hurting my wallet.

sounds more like an intermittent open rather than a short. It might be easy to find once you get the area accessible. Just wiggle wires until the lights go off.

The fusebox is down there. Try changing the fuses. Cheap, and often solves the problem.

Relays can do that too, they’ll stick in one position but when whacked they’ll revert to their normal position. If there are any relays involved with the headlights on that panel, that might be the culprit. The main headlight relays on my Corolla are in the engine compartment but maybe on your truck they’re on a relay panel near that fuse panel.