Assuming your garage door is not too old, it should have “photo eyes” that detect obstacles.

terminate the garage door with its remote.

How To Do a Garage Door Safety Test Video| LiftMaster