The sensors are magnetic inductors, when the wheel turns metal teeth from a ring around the axle pass over and create a small voltage whithin it, this voltage is picked up by the abs ecu to determine that the wheel is moving.
To create enough voltage you have to travel in a straight line at around 10mph or more.
If you wheelspin and only one wheel spins the abs unit thinks that the other wheels have locked up which is why the light turns on, if you get enough dirt between the sensor ond pick up ring it will again thing that that wheel has locked up.
So if a light comes on, check that the ring and sensor are clean, check the gap between sensor face and pick up ring, should be around 0.2 to 1mm , also ensure that you do not have a worn wheel bearing as this can alter the air gap and cause faulty readings in the sensor from incorrect an air gap.
If that does not help get a multimeter , set it on ohms , disconnect each abs sensor, front ones are in the engine bay on the inner wings, big white connectors, connect each probe on the two connectors leading to the sensor , you should be getting around 1000 to 1500 ohms.
If you are , set the meter to ac volts , jack up the car and spin the wheel reasonably fast, you should see an ac voltage of around 0.25 to 0.2 volts AC.
If ok the sensor is good, if either test fails, its a duff sensor.
Hope this helps.