Having an issue with my headlights..

Both aren't working. I checked the fuses and replaced the headlamp relay.

They still don't work.....they will work after driving for about 15 minutes or so. Very strange.

Open for suggestions on what to check. Took both headlights out of the vehicle and checked all plugs to make sure nothing is loose or busted wires.