The next time it won’t start get under the truck and hit it with a mallet, then try to start it. If it works the problem might be a malfunctioning starter.
Very possible, but make sure your shop first double-checks the voltages going to the starter. New starter won’t solve problem if voltage inputs are incorrect.
I appreciate everyone’s input.
You could also take a jumper cable and run it from the battery right to the starter and see what happens. Be sure the truck is in PARK and not in gear when doing this! You will bypass the electronics, relays, and switches. It will also bypass any safety feature like the neutral safety switch, brake interlock switch, etc. If in gear, especially a low gear, the truck will move.