Thats a very simple project overall.
A float sensor that turns on/off a relay to control pump. Transistor
has to be rated for current and voltage and power for relay.
View attachment 137609
Or more sophisticated you can use pressure or capacitive
water level sensor and code an Arduino to control the relay/solenoid.
This also allows one to add safety controls, like pump stall or pump
on too long. Something like this -
Here is mBlock code, not exact, a starting point, you have to check the logic
and order of commands....the values used for sensor tests also would be
changed to conform to your choice of sensors.
Note code is present to detect over current condition in motor for protection.
View attachment 137605
mBlock takes your coding blocks and converts that to Arduino code.
Arduino Nano board, second from left, more that enough, with transistors to
drive relay.
Regards, Dana