Google: ford ranger anti-slosh module
That is one common problem, this module prevents gauge from swinging up and down every time you go around a corner and gas sloshes from side to side in the tank
1989, and up, Ford fuel gauges and senders(float in the tank) use:
10 ohms Empty
158 ohms Full
Behind the dash is a 5volt pulsing power supply that powers the fuel gauge, if gauge works at all then this is OK.
The anti-slosh module is also on back side of dash.
Then there is a Yellow/white stripe wire that runs from the dash to the sender in the fuel tank.
So 158 ohm is high resistance, or NO connection, so if yellow wire had intermittent connection then gauge would go to Full when yellow wire lost connection then read correct level when it had a connection.
A short to ground is 0 ohms, no resistance, so a short on yellow wire would show Empty
So my guess would be yellow wire has a loose connection somewhere or Slosh module does.
The sender also needs a good ground, a loose ground could show same symptom, sender can be grounded at frame near the tank, same ground point as Fuel pump ground, or it can be grounded in the cab, passenger side foot well usually.