Near the floor on each side of your garage door are two small sensors that face each other. If anything breaks the beam between them, the door stops closing and goes back up.
First, check that nothing is in the doorway: a trash can, a broom handle, leaves or a spider web can be enough.
Gently wipe both lenses with a soft cloth, and check that the small lights on both sensors are on and steady. If one flickers, the sensors are probably out of line.
Never disconnect, tape over or bypass the sensors. They are there to keep the door from closing on a person, a pet or a car.
If the door still reverses, the cause may be the opener's settings or a door that binds in its tracks. That's a job for a technician.