Interfacing the water sensor and Electronic Speed Control (ESC) in Arduino Uno

i’m a newbie in arduino. Glad if you could help me how to code water sensor and electronic speed control together with arduino uno. My objective is to detect water using the water sensor, and then the water sensor will act as a switch to turn on the electronic speed control. Then the ESC will control the brushed motor.

Below are my code for controlling brushed motor with ESC

#include <Servo.h>

Servo esc;
int throttlePin = A0; //Potentiometer Pin

void setup() {
esc.attach(9); //ESC Pin
}

void loop() {
int throttle = analogRead(throttlePin);
throttle = map(throttle, 0, 1023, 86, 55); //Rescale to fix
esc.write(throttle);
}