The sensor identifies when one of your lights has stopped working and turns on the brake bulb warning light. This can often be the cause of the brake lights to stop working.
Check for power coming into the sensor from the brake light switch, if you don't have power, check the fuse and brake light switch. If you have power, check for power going to the brake lights. If you have power in and not out, replace the sensor.
Hope that helps, good luck.