all you need is a magnetic hall effect module, power it from the UART port with 3.3v and connect the digital output to the ADC2.
Then in the VESC tool go to App Settings, General and under the General Tab you see the last row is labeled kill stitch, and select mode ADC2 High
Then when a magnet is near the hall it turn the output to the motor on and when the magnet is taken away it kills the motor