The whole of John’s first epistle exhorts those who call themselves Christians to inspect themselves to check they are indeed what they say they are. It can be very easy to think we are something which we are not.
In this short paragraph, John says Christians are those in whom the Spirit of God lives. If the Spirit lives in us, we must know what God has done for us in his great love. For if we do not know the forgiveness of sins through his Son, how can we profess to be Christians? To know the forgiveness of sins, we must know the truth of the gospel and we must believe in the truth.
If we know the love of God through his Son, then we also must love God and in doing so do what he says, obeying his commands, including loving others. In this way, we know we are born of God, and what we claim to be.