1 John says the readers have an anointing from the Holy One and that it teaches them, so they do not need someone to teach them in the same way. It links this anointing to abiding in what they heard from the beginning. See 1 John 2:20 and 1 John 2:27.
In 1 John 2:18–23 the writer warns the community that a decisive period has arrived, shown by the appearance of “many antichrists.” These people once belonged to the group but have left, exposing that they were never truly aligned with it. The readers, however, are told they possess an “anointing” that enables them to know the truth. This unit sits inside a larger section that contrasts faithful continuity with deceptive teaching and urges the readers to remain in what they have heard from the beginning.
This passage treats a community crisis: some people who were once part of the group have left and are now identified as serious opponents. The writer reads their departure as revealing something about them: they did not truly “belong” in the way that matters for this community’s identity (explicit in verse 19).
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with 1 John 2:20, then read the surrounding section so the answer stays connected to the passage's flow.
20You have an anointing from the Holy One, and you know the truth.