But the sure foundation of God stands: he shows how heresies do not altogether subvert the faith. For these foundations are the persons to whom is given the grace to stand immovable: for it was founded upon a rock (Matt 7:25); it stands firm, because it cannot be moved. Hence Matthew first said: and the rain fell and the floods came and the winds blew and they beat upon that house: and it fell not (Matt 7:25).
Its firmness depends, first of all, on God's predestination; second, on our free will.
Hence in regard to the first he says: this sure foundation having this seal, i.e., this is the si...gn of its firmness: he that has received his testimony has set to his seal that God is true (John 3:33). And this is the first part of the seal, namely, from divine predestination, for the Lord knows who are his: I know my sheep, and other sheep I have that are not of this fold (John 10:14); I know you not (Matt 7:23).
But as to the second he says, let everyone depart from iniquity, who names the name of the Lord. As if to say: they are so predestined by God as to be saved by their free will: because one shows that he is predestined, if in the end he does not adhere to sin.
And he mentions two things which pertain to those predestined to be saved: first, they confess the faith; hence he says, everyone who names the name of the Lord: but with the mouth, confession is made unto salvation (Rom 10:10); second, that they withdraw from sin: not everyone that says to me, Lord, Lord, shall enter the kingdom of heaven (Matt 7:21). Hence he says, let everyone depart from iniquity: let the wicked forsake his way (Isa 55:7).
But the fact that he says, who names the name, must be understood not of orally naming, but inwardly by faith and outwardly by good works.
Source: Commentary on 2 Timothy