It says not to believe every spirit but to test them, because many false prophets have gone out into the world. The key test given is whether they confess Jesus Christ has come in the flesh. See 1 John 4:1–2.
In 1 John 4:1–6 the writer warns the community not to accept every claimed spiritual message without checking it. This unit sits in a larger stretch where the letter marks out signs of what is genuine versus deceptive within the community.
The passage assumes that spiritual-sounding messages are not automatically trustworthy. It speaks as if multiple voices claim spiritual backing, and some of them are “false prophets” (explicit). The writer gives a central, public test: whether a message openly affirms that Jesus Christ has come “in the flesh” (explicit).
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 4:1-2, then read the surrounding section so the answer stays connected to the passage's flow.
1Beloved, don`t believe every spirit, but test the spirits, whether they are of God, because many false prophets have gone out into the world.
2By this you know the Spirit of God: every spirit who confesses that Jesus Christ has come in the flesh is of God,