There is usually an on-off button that engages this feature. As the driver anticipates a stop (traffic light or stop sign), they can start to release the gas pedal and the vehicle will start to decelerate and gradually slow the car. Once the vehicle comes to a complete stop, the hydraulic brakes engage to prevent the vehicle from moving until the gas pedal is pressed again.
Although two-pedal driving is pretty straightforward, one-pedal driving requires some practice and fine-tuning to perfect. It requires gentle release of the gas to result in a smooth stop. But the driver also needs to get used to judging correct stopping distances and timing the release of the pedal accurately to safely stop the vehicle.