so that they may come to their senses and escape the devil’s trap, having been held captive by him to do his will.
In context
24And the Lord’s servant must not be quarrelsome, but kind to everyone, able to teach, patient when wronged, 25correcting his opponents with gentleness, in the hope that God may perhaps grant them repentance leading to a knowledge of the truth, 26so that they may come to their senses and escape the devil’s trap, having been held captive by him to do his will.