Try not to let the fuel tank out of fuel since this allows the filth from the bottom of the tank to get stuck in the variable resistor and make it hard to give the correct reading.
Using an ohmmeter measure the resistance between the two terminals of variable resistance. You then need to compare it with the full and half tank values stated in the vehicle manual.
If you find another value, this means that the variable resistance is having a problem. Try to rub it with abrasive and rust cleaner and try one more time until you get the pre-stated values. You can then place the sensor back. If you still give the wrong values, the fuel level sensor needs to be changed as soon as possible.
-------
Sodium Hypo Chlorite