I hate intermittent problems like this. About enough to drive you crazy.
First check is always battery.
Good volts?
Pass load test?
Good, clean, tight connections at the posts?
Next step - cable connections.
Good, clean, tight connection where grounded to the frame or motor?
If grounded to frame, is the ground strap from engine to frame good, clean, tight?
Is the positive connection to the starter post good, clean, tight?
If cable is tight to starter post, verify that post is not loose in solenoid. (I've had this happen.)
Step 3 - activation circuit
Is the small wire going to the small post on the solenoid good, clean, tight?
Using an assistant to turn key, verify good voltage to small post when key turned to start position.
If voltage isn't good to small post, it's in the truck side of things.
If voltage is good, I would pull and test starter. Or swap a known good one, if handy.
For quick reference,
A clack type sound generally means solenoid is activating, but not enough juice, starter bad, or bad connections.
A click type sound generally means the starter relay is working, but there's a problem somewhere from there to the solenoid.
A humming sound, typically from the rear would be the fuel pump.