I assume this is for a radio controlled device (RC car or RC airplane/drone. If so, the radio receiver module should connect to the ESC and you transmit your desired speed with the lever on the transmitter radio box (controller).
Otherwise, you'll have to post the exact ESC make, model number and (hopefully), datasheet. The datasheet will explain the control mechanism. Sometimes, a simple potentiometer, other times it is serial communication with
UART, SPI or I2C protocol. Or pulse-width-modulation (PWM). Post the datasheet or what ever info you have.