2 Tim 2:19, NIV: "Nevertheless, God's solid foundation stands firm, sealed with this inscription: 'The Lord knows those who are his,' and, 'Everyone who confesses the name of the Lord must turn away from wickedness.' (TM)
Paul has just been talking (in verses 17-18 (TM)) about Hymenaeus and Philetus. They have messed up big time, teaching that the resurrection had already come and gone. This was causing believers trouble, the NIV saying it was "destroying" faith, while The Message puts it more mildly, saying it was "throwing believers off stride." This probably represents the two extremes that occur when false teaching is introduced into the church: being thrown off stride on the one hand, and destruction on the other.
So Paul says, "Nevertheless." That means, all this bad stuff has happened, for sure, but anyway, but still, but in spite of all that. . .
In spite of all that, God's work stands firm, the church's foundation stands firm, and Paul says that it is sealed with two inscriptions.
One says that the Lord knows who belongs to him. Have you ever been a member of something, and the top dog won't give you the time of day? Maybe the leader doesn't even know who you are. That's discouraging, but God is not like that. He knows everything about you, even how many hairs are on your head. And when you belong to him, he knows about it. He is totally aware that on August 16, 1998 or whenever, you gave your heart to him. You know how embarrassing it is when someone who should know who you are, doesn't? That never happens with God. He knows, and he knows you.
The other inscription says that if you claim the Lord then you have to turn away from bad stuff. A lot of people hear this and think that they're expected to immediately and suddenly become perfect, never sinning, never falling short in any way of what God wants from them, but that's not what this verse is saying.
This verse is talking about your whole life. Look at 1 John 1:8-10 (TM) and Romans 7:15 (TM). The point is that we all struggle; we all make mistakes. You are going to fall short at times. I am going to fail sometimes. But turning away from our failures has to be done. If it's a problem with hating Fred, then I have to turn away from hating Fred, and turn toward loving him the way Jesus wants me to. I might do something hateful to him again tomorrow at 3:00 pm. This means that at 3:01 I'll have to turn away from hating Fred again, and I'll have to do it again as many times as it takes. That's what this second inscription means.