Passage
And he that keepeth his commandments abideth in him, and he in him. And hereby we know that he abideth in us, by the Spirit which he gave us.
And he that keepeth his commandments abideth in him, and he in him. And hereby we know that he abideth in us, by the Spirit which he gave us.
1 John 3:22 and whatsoever we ask we receive of him, because we keep his commandments and do the things that are pleasing in his sight.
1 John 3:23 And this is his commandment, that we should believe in the name of his Son Jesus Christ, and love one another, even as he gave us commandment.
1 John 3:24 And he that keepeth his commandments abideth in him, and he in him. And hereby we know that he abideth in us, by the Spirit which he gave us.
The verse centers on "Spirit", "keepeth", "commandments", "abideth", "hereby", and "gave". It is saying that the verse draws attention to "Spirit" and "keepeth", so its meaning should be read from those terms before moving to application.
The prior verse says "And this is his commandment that we...", giving immediate footing for "Spirit" and "keepeth". In 1 John context, the local focus is Christ, faith, and discipleship.
A plain takeaway is to answer the verse's own emphasis on "Spirit" and "keepeth" with trust shaped by these words, not by a vague optimism outside the passage.