Use a Relay with the Float Switch
It’s important to note that you must use a relay with your float switch. The float switch usually can only handle signal currents (typically up to 0.5 A or more), not power currents.
It’s the relay’s job to get the signal from the float sensor and then relay the output to the water pump to control water flow.
Please see a suggested wiring diagram below:
Wiring the Relay
The relay’s output (NO, C, and NC) doesn’t output any voltage even if you supply an input voltage to the relay module. The reason is that the relay’s outputs are only contact switches (e.g., DPST Double Pole Single Throw switch). With this, you have to connect a voltage source in series with the common and NO or NC terminals, along with your load or water pump, as in the diagram above.