Ford ranger 2001 3.0 v6 2 wd

after driving my truck for a few hours a day it doesnt want to start it cranks ok but it just wont start it feels like no fuel is getting to the injectors i let it cool down around 30 min then it just starts this happens to me twice a week aprox. i replaced the fuel crank sensor. but to no avail. can anybody help me.

Hook up a fuel pressure gauge to the rail

When it doesn’t start, what does the gauge read

Those are the classic symptoms of something electronic in the ignition system having become heat-sensitive and fritzing out when it gets hot and returning to normal when it cools down.

Good advice from db4690 above. I’d check to make sure the spark plugs were firing too. It was a good idea to suspect the crank sensor, as those can reportedly fail under hot soak conditions. Sometimes there are both crank sensors and cam sensors used by the ignition system, and a failure w/either one can cause a no-spark , and therefore no-start, condition. The ignition module can fail also, so it’s worth it I think to do a basic spark test.