The garage door opener has a safety feature built into it. If it senses an obstruction while closing it will reverse to the open position. You have two adjustments for this feature, down travel and down force.
If the door is closing completely then reversing your down travel is adjusted to low. You can turn the adjusting screw on the motor unit to correct this.
If the door is reversing before it closes completely you have something making the door want to hang, or your down force needs to be stronger.
Before you adjust the down force you need to check some things on the door hardware. Don't adjust the down force without checking the door.
Without your model number I don't know if you have door safety sensors. If you do and they are reversing the door the work lights on the motor unit will flash when the door opens or the LED on the rear of the motor unit will blink a code. Sometimes if there is a problem in the door hardware the door rails will twist causing the sensors to move and reverse the door.
Here are some things you can do to check the operation of the door. With the door in the down position, pull the rope hanging down from the rail to release the door from the trolley. Open and close the door several times and feel for rough places, or places the door tries to hang. If it has places it wants to hang, you need to check the rail for bends or the rollers for wear. If the rollers are rough you can lubricate them by placing 2-3 drops of light oil inside the rollers on the bearings. If the door moves smoothly, move it to the half open position and see if it stays there. If it does not stay, you have a problem with the door springs. Door springs are very dangerous, you should have a professional repairman do any work to the springs. If it stays at center the door springs are good and properly adjusted.
Garage doors can be very dangerous and sometimes deadly, don't bypass any safety features.
If you determine nothing is wrong with the door adjust the down force slightly stronger. If that solves the problem you need to check the safety by catching the door with your hands while it is closing. You should be able to stop the door without straining. If you can't, adjust the down force less and try again.