Ford Ranger fuel pump won't turn on

sometimes the fuel pump will not turn on when switch is turned to start position.

Sounds like either the fuel pump relay, the ignition switch, or the fuel pump is failing. Check them in that order. Just replace the fuel pump relay, it is cheap and easy. If that doesn’t fix it, try jiggling the key when you try to start. If that works, replace the ignition switch. Next would be the fuel pump. If the pump is the problem and you do nothing, the pump will eventually fail so you will KNOW that’s the problem.