Get some Quick Start starting fluid, ether in a spray can.
Next time it stalls and won't start spray some into the intake, i.e. pull off the PCV vacuum line or power booster line from the intake, spray some into the intake and then put line back on.
If it starts then fuel is the issue, if it still doesn't start then spark is.
On the fuel rail there is a fuel pressure regulator, there will be a vacuum line attached to it.
Remove the vacuum line and smell it for gas, if you smell gas replace regulator, diaphragm is leaking.
Also make sure you use Motorcraft spark plugs, Rangers eat all other brands which can cause poor starting.