30-40psi is running fuel pressure in 1997 and earlier Ranger(or Explorer)
+1 on MAF sensor, but CLEAN IT, don't replace it, common cause of bucking in the 4.0l vehicles is dirty MAF sensor
Change fuel filter, every 5 years
Put a vacuum gauge on the intake, start engine, should see 18-21" of vacuum
Raise RPMs a bit and hold it there, if vacuum starts to drop you have a Clogged Exhaust, air(exhaust) can't get out so new air with fuel can't get in, so limited RPM and bucking
Vacuum gauge is maybe $30 and one of the best tools to diagnose a running gasoline engine
Is the CEL(check engine light) on?
You can get a OBDII Bluetooth code reader for $15
It will tell you if a sensor is out of range, not bad just out of range, so NEVER EVER change sensors(except O2s) unless you get a CEL and code, AND you test the sensor first
Just a heads up
My 1994 4.0l has over 400k and all original sensors, except O2s, they wear out after 12 years, only sensors that do
Not lucky just most sensors never wear out
95% of DIY sensor changes were not bad, but the one that gets me the most are 60% of Pro-Mechanic sensor changes were not bad, lol, but they still charge you for the new sensor you didn't need