The one on the top of the manifold, near the valve cover is for the gauge.
The one at the front of the manifold (green) is for the ECU.
It influences how rich/lean your truck runs.. I don't actually know if toyota uses an open/closed loop based on temp, however.. Basically the colder your truck is the more fuel it'll be given by tht ECU.
Note - LC makes a little "variable resistor" box for $50 that ties into the water temp circuit... It's marked rick/lean and all it does is impact what the ECU is reading for temperature.
If you want to know what temperature the ECU is reading, you need to check the resistance at that sensor with the connector off of it.
Broadly, it's a linear relationship between temperature and resistance. Plot these values on a graph and then you can figure out what temperature your ECU is reading based on the resistance value of that sensor..
32 F 5750 ohm
66 F 2830 ohm
212F 200 ohm
If you want to test the sensor itself, pull it out.
Test it at room temperature, test it in ice water, and test it in boiling water. I think a failure is unusual.
There is another temp sensor for cold start - brown - it's the same type of sensor, but uses different values. Someone else will have to fill you in on how that works.
Other notes: At operating temperature, the coolant temp sensor will almost always read slightly colder than your gauge sensor. I think this is due to position - it's farther out from the head and in a good path for coolant.