Why doesn't my garage door close unless I am holding down the button?
The garage door will automatically reverse if it encounters too much resistance or if the sensor beam is interrupted.

To check for resistance, start with the door closed and pull the red handle. Then open and close the door. The movement should be fluid with no tough spots. If you encounter difficult spots, you likely have a bent track, a broken wheel, or a severe lack of track lubricant. Call a professional.

If the door opens with the opener fine, but reverses almost immediately when you try to close it, then you likely have a problem with your sensor alignment. One sensor should have a light on all the time. This is the transmitter. The other, your receiver,  should light up when it has an unobstructed view of the invisible light beam the transmitter sends. It's easy to bump a sensor and move it out of alignment. Just bend it back in to position. Use the light on the receiver to help you so that you don't have to try and close the door to check your adjustments.