Most garage door openers have infrared sensors placed near the floor on either side of the garage door. These garage door sensors are used as a safety precaution. If something breaks the infrared beam of light, the garage door will not close. So, if for some reason, you are having problems closing your garage door, the first thing you should check is if something is blocking them.
Garage door openers are required to come with these door sensors as noted by Underwriters Laboratories specification 325. This was passed in 1993. Part of UL 325 specifies standards for doors in case of entrapment. If something is found to be an obstruction the door is stopped and then reversed if it is in motion. Before the door moves, if an obstruction is found (determined by a break in the infrared light of the sensors), the door will not go down.
Aligning the sensors is easy. Simply point them at each other. Each sensor has either one or two colored lights. Most often, sensors with a red or green light work with an Overhead or Genie garage door opener. Sensors with two lights, usually green and yellow work with Chamberlain garage door openers. On the sensors with two lights, one of them indicates power to the sensor. The other light indicates whether the sensor is aligned. The lights should be lit up on both sensors. This is the way you will know they are properly aligned.
Another technique you can use to align the sensors is to tie a piece of string from one sensor on one side of the door to the other sensor on the other side of the door. Then take a level and line it up with the string. If it is not level, adjust the sensors and repeat.