The ESP system uses sensors to monitor the car's speed, steering angle, and yaw rate (how fast the car is rotating around its vertical axis). If the system detects that the car is starting to skid or lose control, it will apply the brakes to individual wheels and reduce engine power to help bring the car back under control.
The ESP warning light will usually come on when you are driving in slippery conditions, such as snow, ice, or rain. It may also come on if you are making a sudden turn or taking a corner too fast.
If the ESP warning light comes on, it is important to slow down and drive cautiously. The ESP system can help you to avoid accidents, but it cannot completely prevent them. Always drive within the limits of your own abilities and the road conditions.