2001 Ford Ranger intermittent starting issues

I have this 2001 Ford Ranger and having some intermittent starting issues. Usually happens after I have taken it out and drive for about 30 minutes or so and shut if off then try and restart it right away. I cannot hear the fuel pump prime when I turn the key to “on”, I do not hear the buzz or whining sound that you normally hear for 2 or 3 seconds. However, if I let it sit for about 30-45 minutes then it will start right away and run fine. Other times when its driving I have NO issues with it missing out or lacking fuel. Does it sound like the fuel pump relay is faulty, can the relay stop working when it gets warm, then start working after it cools down. Why would the fuel pump not all of a sudden get power then after it sits 30-45 minutes it starts and works like a charm? It has only 45,000 miles in it.

Here’s what I would do . . .

Open the passenger door

Carefully look at and touch the inertia switch

Is it or the wiring crispy and/or melted?

Another test . . . try to unplug the electrical connector

If it won’t budge, the wiring and switch are shot

Would the inertia switch reset itself automatically because when the engine sits for about 30 minutes or longer it will then start and drive fine?