A little more info on the truck would be helpful.
Try adding it into you signature to ease us in assisting.
Do the marker lights on the front of the truck work?
If not, more than likely ithe problem is the headlight switch in the dash.
Now if the bulbs are good then check the wire harness conection at the rear most frame crossmember. It will be just forward of the rear bumper.
The harness runs back there on the drivers side and the connectors are there for the tail light harness. Make sure the connector pins are clean and corrosion free.