Once you find the sending unit ground on the side of the frame rail, you will understand how it gets corroded and makes a bad connection. It’s fully exposed to road dirt, oil, etc. Remove the bolt, sand the frame and wire connector down to bare metal, and screw everything back down tightly...