If you go here: How To Replace the Upper and Lower Thermostat Housing on a Ford 4.0L V6 SOHC Engine
This repair is for a leaking thermostat housing, common issue for the 4.0l SOHC
(4.0l OHV engines were in rangers from 1990-2000, 4.0l SOHC were in Rangers from 2001 and up, completely different engines, just FYI)
If you go to Step 4 and look at the last picture you will see the two Temp sensing devices, and how to remove them in Step 5.
One will be a temp SENDER, that is for the temp gauge.
The other is a temp SENSOR, that is for the computer.
Now to confuse things.............Ford at some point switched to just one SENSOR, so they got rid of the SENDER, and the computer runs the temp gauge.
2002 should have the two.
Sensor will have Light Green/red stripe and Gray/red stripe wires
Sender will have red/white stripe and Black/white stripe wires
To test the gauge and wire, get a jumper wire and connect it to a Ground, battery negative is fine.
remove Sender connector.
Turn on the key
Put Grounded wire on to the Red/white stripe wire, the temp gauge should go all the way to HOT, all the way, if it does then Red/white wire and gauge are good.
The Black/white strip wire is a Ground.
So now use that jumper wire to connect Red/white and Black/white wire together, gauge should go to HOT again, all the way up, if it does then Black/white wire is a good ground.