x2 - Its usually sockets and grounds. IIRC, each light has small ground wire that needs to be firmly screwed down to bare metal near the socket. You can also buy a spray can of Deoxit to clean off the terminals inside the sockets. A pencil eraser works fairly well to clean the sockets inside, but the Deoxit seems to work better on old corrosion.
There is also a ground wire on the radiator support for each headlight, and a white, large gauge ground wire to the frame in the back of the truck up behind the middle of the rear bumper.
The other very important ground is the black wire up under the instrument panel. It may be grounded to the emergency brake mechanism, or to a ground bar under the dash. If that ground wire is broken it will cause multiple issues with the instrument panel lights.
Bruce