1 John 2:4

2 He Himself is the atoning sacrifice for our sins, and not only for ours but also for the sins of the whole world.

3 By this we can be sure that we have come to know Him: if we keep His commandments.

If anyone says, “I know Him,” but does not keep His commandments, he is a liar, and the truth is not in him.

5 But if anyone keeps His word, the love of God has been truly perfected in him. By this we know that we are in Him:

6 Whoever claims to abide in Him must walk as Jesus walked.

Do read the surrounding verses too, because the context often says more than a single verse.

Compare

BSB
If anyone says, “I know Him,” but does not keep His commandments, he is a liar, and the truth is not in him.
KJV
He that saith, I know him, and keepeth not his commandments, is a liar, and the truth is not in him.
WEB
One who says, “I know him,” and doesn’t keep his commandments, is a liar, and the truth isn’t in him.
ASV
He that saith, I know him, and keepeth not his commandments, is a liar, and the truth is not in him;
DARBY
He that says, I know him, and does not keep his commandments, is a liar, and the truth is not in him;
BLB
The one saying, “I have known Him,” and not keeping His commandments, he is a liar, and the truth is not in him.
ÅB
Den som sier: Jeg kjenner ham, og ikke holder hans bud, han er en løgner, og i ham er ikke sannheten;
OTB
Den som sier: "Jeg har kommet til å kjenne Ham," men ikke holder Hans bud, bedrar seg selv, og sannheten er ikke i ham;
B1930
Den som sier: Jeg kjenner ham, og ikke holder hans bud, han er en løgner, og i ham er ikke sannheten;

Study notes (Tyndale)

Original text and word study

Cross references