“Finally then, brothers, we ask and exhort you in the Lord Jesus, that as you received from us as to how you ought to walk and please God (just as you actually do walk), that you excel still more. For you know what commandments we gave you through the Lord Jesus. For this is the will of God, your sanctification: that you abstain from sexual immorality;” 1 Thessalonians 4:1-3 LSB https://bible.com/bible/3345/1th.4.3.LSB
The confusion of the Christian life occurs over the matter of the necessity to obey God. We are all rebels against God, having been born that way, so we all look for a way to be just in our own sight to do whatever we want while being accepted by God for being right in His sight. On the one hand, no person can do good and get to heaven. All people need the good of Jesus appropriated to them to enter heaven. If we can do good and earn heaven then Jesus did not need to die on the cross for the failure of men to be able to do enough good to enter heaven. Jesus died on the cross for the punishment of humanity for none of us can live good enough to earn heaven and therefore all of us would be condemned by God but God so loved the world that He lived a perfect life among us as one of us to die for all of us as the perfect sacrifice. He appropriates to us through the power of His resurrection the perfection He lived while being with us on earth. Yet we must obey God for it is in obeying God that we demonstrate our love for God and prove to the world that God is love. Obeying God is loving others as we love ourselves. Forgiving the unforgivable. Loving the unloveable. Having mercy on the merciless. Pardoning the unpardonable. Sacrificing for the unworthy. This is what God has done for us and what He calls His people to do for others. Our sanctification, our becoming like Jesus, is what God is doing in us to prove through us that He exists and that He loves all people unconditionally and sacrificially. It is in our obedience to Him by loving others that we prove our love for God and God’s love for others. Therefore we must obey God not to earn heaven but to demonstrate heaven is real by the presence of God working through us to accomplish the will of God by us.