Passage
And he that keeps his commandments abides in him, and he in him. And hereby we know that he abides in us, by the Spirit which he has given to us.
And he that keeps his commandments abides in him, and he in him. And hereby we know that he abides in us, by the Spirit which he has given to us.
1 John 3:22 and whatsoever we ask we receive from him, because we keep his commandments, and practise the things which are pleasing in his sight.
1 John 3:23 And this is his commandment, that we believe on the name of his Son Jesus Christ, and that we love one another, even as he has given us commandment.
1 John 3:24 And he that keeps his commandments abides in him, and he in him. And hereby we know that he abides in us, by the Spirit which he has given to us.
The verse centers on "Spirit", "keeps", "commandments", "abides", "hereby", and "given". It is saying that the verse draws attention to "Spirit" and "keeps", 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 "keeps". 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 "keeps" with trust shaped by these words, not by a vague optimism outside the passage.