Electric garage door openers are a great innovation, but as is the case with every electric/electronic component, things can go bad and malfunction. The sensors that make garage doors safer must be located in the worst possible place, close to the floor. This means they're subjected to water, dirt and physical damage from careless drivers and children. Fixing them so they work properly can be an annoying task, but sometimes just a few quick things will have your garage doors opening and closing like new again.
Look for any physical objects that are preventing the sensors from seeing each other. This includes any dirt or other debris that is on the lens. Depending on the model of sensor, the lights may indicate whether the glass eyes of the sensors are obscured.
Confirm that the sensors are properly aligned. If necessary, tighten the brackets that hold them into place or replace the brackets entirely.
Make sure the unit is powered on and that the sensors are getting electricity. If the lights on the sensors aren't on, check the power to the main part of the unit.
Check the wires leading to the sensors and the connections, both at the main unit and on the sensors themselves. Replace the wires if they're frayed or damaged.
Open up the sensor units themselves. Confirm that the wiring is soldered to the proper places, that there are no foreign objects inside them and that they are dry inside.
Finally, if nothing else works, try replacing the units. In most cases that will solve the problem, but sometimes a bad circuit board in the main unit is responsible for non-functional sensors.