Look at the damage to the duct. Solid ducts rarely get punctured in the middle, but they can get loose where they join other sections. Flexible ducts can also come loose, or they can develop small tears. If the duct is loose, push it onto the connection.
Clean the area with with a damp cloth or paper towel. It does not have to be spotless, but you will get a better seal if it is not too dirty.
Apply water-based mastic sealant to the gap or tear with a brush. Apply it liberally to cover the whole gap. Give it about 10 minutes to start to cure.
Cover the patch with mastic tape. The tape should completely cover the mastic sealant and overlap with the bare duct as well.
Wait a couple of hours for the patch to cure. Then turn on the air conditioning. Move your hand around the patch to feel for air. If you did the patch right, there should be not air leaking out.