Also, the mere mental acceptance of Christ is distinct from having a relationship with Christ, from Christ
knowing you or you he. If you want to know Christ, for him to know you, then you must do the will of the Lord. If you do not, then Christ will say: ‘I never knew you; depart from Me, you who practice lawlessness.’ (Matthew 7:23)
The parable of the sheep and goats makes this distinction quite clear:
Matthew 25:31-46 “But when the Son of Man comes in His glory, and all the angels with Him, then He will sit on His glorious throne. 32 All the nations will be gathered before Him; and He will separate them from one another, as the shepherd separates the sheep from the goats; 33 and He will put the sheep on His right, and the goats on the left.
34 “Then the King will say to those on His right, ‘Come, you who are blessed of My Father, inherit the kingdom prepared for you from the foundation of the world. 35 For I was hungry, and you gave Me something to eat; I was thirsty, and you gave Me something to drink; I was a stranger, and you invited Me in; 36 naked, and you clothed Me; I was sick, and you visited Me; I was in prison, and you came to Me.’ 37 Then the righteous will answer Him, ‘Lord, when did we see You hungry, and feed You, or thirsty, and give You something to drink? 38 And when did we see You a stranger, and invite You in, or naked, and clothe You? 39 When did we see You sick, or in prison, and come to You?’ 40 The King will answer and say to them, ‘Truly I say to you, to the extent that you did it to one of these brothers of Mine, even the least of them, you did it to Me.’
41 “Then He will also say to those on His left, ‘Depart from Me, accursed ones, into the eternal fire which has been prepared for the devil and his angels; 42 for I was hungry, and you gave Me nothing to eat; I was thirsty, and you gave Me nothing to drink; 43 I was a stranger, and you did not invite Me in; naked, and you did not clothe Me; sick, and in prison, and you did not visit Me.’ 44 Then they themselves also will answer, ‘Lord, when did we see You hungry, or thirsty, or a stranger, or naked, or sick, or in prison, and did not [e]take care of You?’ 45 Then He will answer them, ‘Truly I say to you, to the extent that you did not do it to one of the least of these, you did not do it to Me.’ 46 These will go away into eternal punishment, but the righteous into eternal life.”
What you see here is that Christ considers what you do or don't do to others, to the least of these, you have done or not done to him. This is how you know God, how you are known by God: you love him and you love your fellowman. Not with pretty words, but in truth and action. As Paul taught in Romans 2, even one who never received the Law of God can yet do what is right. And if they do right by the least of these, then they are known by God.
1 Cor 8:2-3 If anyone supposes that he knows anything, he has not yet known as he ought to know; 3 but if anyone loves God, he is known by Him.