Truck won't start after being warm?

I have a 2007 Ford F450 truck that runs well, and starts up when it is cold. But after run it until its gets warmed up I turn it off and try re starting it and it refuses to start up again afterwards. Anyone know what the problem is? Please help!

2007 Ford F450 with an engine 6.0
Turbo/diesel

Replace the temp sensor.

Could be the temp sensor, it is a sensor of some sort. See when you start your truck cold, it is in a closed loop condition. Which means it is relying off pre-set mixtures and things in the computer. After it warms up, it opens loop and starts relying on all the sensors for all the information. When you have a bad sensor this can happen. Truck will run fine cold then get warmed up, computer switch to sensors for information and boom truck will die. I had a bad 02 sensor one time do this too. Truck would run perfect cold and the second it warmed up it would die. Finally unplugged it and then it ran fine all the time, till I got a new one.

Since you have 6.0 I hope you have replaced the head studs allready or are saving up for it.