Obedience does not justify our eternal salvation but as a true believer obeys God out of a heart of gratitude for the grace we received in Jesus Christ.
1 John 5:2–3
By this we know that we love the children of God, when we love God and obey his commandments. For this is the love of God, that we keep his commandments. And his commandments are not burdensome. (ESV)
2 John 6
And this is love, that we walk according to his commandments; this is the commandment, just as you have heard from the beginning, so that you should walk in it. (ESV)
1 John 2:3–6
And we can be sure that we know him if we obey his commandments. If someone claims, “I know God,” but doesn’t obey God’s commandments, that person is a liar and is not living in the truth. But those who obey God’s word truly show how completely they love him. That is how we know we are living in him. Those who say they live in God should live their lives as Jesus did.
If you love me, you will keep my commandments. (ESV)