1997 Ford F-250 engine shuts off while driving

cold engine starts right up.After 10 mins. of drive time,shut the engine off. Doesn’t start right back up. Turns over but doesn’t start. Wait 5 mins it starts up runs normal till shut off again.

A bad crankshaft position sensor will cause that.

https://www.rockauto.com/en/catalog/ford,1997,f-250,5.4l+v8,1125133,ignition,crankshaft+position+sensor,7196

Tester