This is a circuit diagram which automatic stop the pump, when tank is full.
In this you can see three push button two are NO, and one is NC, left NO push button is to start the motor and NC to stop, and right NO push button is a float switch which put at the required height in tank. And bulb is as a pump.