That would depend, there are numerous options depending on the hardware.
You can use an analog output to a drives analog input to use V (0-10) or milliamp (4-20) as speed control.
A fieldbus (Profibus etc) offers methods to control speed.
Those were just 2 examples but there are many more options.
The specific HOW TO would depend on several factors which you have not provided enough details to offer specific assistance.