We need to die to the law of sin in order to be free to obey the Law of God, not the other way around. In Titus 2:14, it does not say that Jesus gave himself to free us from God's law but in order to free us from all lawlessness and to purify for himself a people of his own possession who are zealous for doing good works, so the freedom that we have in Christ is not the freedom to sin but the freedom from sin.
Romans 8: 10 by God's word if the Spirit of Jesus is in us we are dead physically. We cannot sin because dead men are not under the law.
Everyone who has faith will be declared righteous and everyone who has faith is a doer of God's law, which is how Paul can deny in Romans 4:1-5 that we can earn our righteousness as the result of our works while also affirming in Roman 2:13 that only the doers of the law will be declared righteous. In 1 John 3:4-10, everyone who is a doer of righteous works in obedience to God's law is righteous even as they are righteous and those who are not doers of righteous works in obedience to God's law are not children of God. Jesus embodied the righteousness of God through his works by setting a sinless example for us to follow of how to walk in obedience to God's law, so that is what we also have the gift of getting to obey the we receive the gift of the righteousness of God.
Are you are saying that we have to do works of the law to be righteous?
Romans 10:1 Brethren, my heart's desire and my prayer to God for them is for their salvation. 2 For I testify about them that they have a zeal for God, but not in accordance with knowledge. 3 For not knowing about God's righteousness and seeking to establish their own, they did not subject themselves to the righteousness of God. 4 For Christ is the end of the law for righteousness to everyone who believes. NASU
Anyone, who says that Christians have obey the law to be righteous, does not believe in Jesus. In verse 3 those who are ignorant of God's righteousness seek to establish their own righteousness, by doing the law. If anyone does not believe that Jesus makes them righteous, they think that they must do the law. God's righteousness is through faith not works. It seems to me that you might believe that James, the brother of Jesus, said one must have works to have a saving faith.
Since the apostle James, brother of Jesus, used Abraham to prove a point about salvation in the NT, I will use an OT saint, David, to prove another point about salvation. Since both Abraham and David are listed in Hebrews 11 as having saving faith, I know they both are sons of God. Because of that I know in Romans chapter 8, where Paul describes what true believers do to be in the Spirit, they have reached being sons in verse 14.
First David's sins read 2Samuel 12: 7- 15.
Every Christian should know what King David did. He committed adultery with Bathsheba and had Uriah, her husband, killed to cover his crime. Under OT laws He committed 3 sins that could not be forgiven. David committed both sins, adultery and murder, in a high handed way, Numbers 15:30, putting them both as the worst sins under the OT law. There was no sacrifice for what David did but death to both her and him. David was unrepentant for more than 9 months.
Romans 8:1 Therefore there is now no condemnation for those who are in Christ Jesus. 2 For the law of the Spirit of life in Christ Jesus has set you free from the law of sin and of death. 3 For what the Law could not do, weak as it was through the flesh, God did: sending His own Son in the likeness of sinful flesh and as an offering for sin, He condemned sin in the flesh, 4 so that the requirement of the Law might be fulfilled in us, who do not walk according to the flesh but according to the Spirit. 5 For those who are according to the flesh set their minds on the things of the flesh, but those who are according to the Spirit, the things of the Spirit. 6 For the mind set on the flesh is death, but the mind set on the Spirit is life and peace, 7 because the mind set on the flesh is hostile toward God; for it does not subject itself to the law of God, for it is not even able to do so, 8 and those who are in the flesh cannot please God. 9 However, you are not in the flesh but in the Spirit, if indeed the Spirit of God dwells in you. But if anyone does not have the Spirit of Christ, he does not belong to Him. 10 If Christ is in you, though the body is dead because of sin, yet the spirit is alive because of righteousness. 11 But if the Spirit of Him who raised Jesus from the dead dwells in you, He who raised Christ Jesus from the dead will also give life to your mortal bodies through His Spirit who dwells in you. 12 So then, brethren, we are under obligation, not to the flesh, to live according to the flesh — 13 for if you are living according to the flesh, you must die; but if by the Spirit you are putting to death the deeds of the body, you will live. 14 For all who are being led by the Spirit of God, these are sons of God. 15 For you have not received a spirit of slavery leading to fear again, but you have received a spirit of adoption as sons by which we cry out, "Abba! Father!" 16 The Spirit Himself testifies with our spirit that we are children of God, 17 and if children, heirs also, heirs of God and fellow heirs with Christ, if indeed we suffer with Him so that we may also be glorified with Him. NASU
If a Christian committed the sins in the NT that David committed the scriptures above describe what would happen to him. Again, since both Abraham, used by James, and David are saints, listed in Hebrews 11, we know they both had passed from death to life. That means they both had proven records of hearing and obeying God's word, they both had spiritual minds. In Romans above it means verse 6 applied to them. With spiritual minds they responded by obeying Jesus' directions. They both were sons of God. John 10: 1-6 Once a Christian proves they have a spiritual mind and follow Jesus' voice they prove they are one of His sheep. Therefore, our NT David had passed through Romans above down to verse 17.
Romans 4:5 But to the one who does not work, but believes in Him who justifies the ungodly, his faith is credited as righteousness, 6 just as David also speaks of the blessing on the man to whom God credits righteousness apart from works: 7 "BLESSED ARE THOSE WHOSE LAWLESS DEEDS HAVE BEEN FORGIVEN, AND WHOSE SINS HAVE BEEN COVERED. 8 "BLESSED IS THE MAN WHOSE SIN THE LORD WILL NOT TAKE INTO ACCOUNT." NASU
(First in the above,
the one who does not work means, if one is doing work for righteousness, they do not have faith. Which means they do not have righteousness through faith)
Because our NT David was in Jesus and Jesus was in Him, God did not impute any sin to David all the time he was unrepentant. God treated him as a disobedient child. If our David had not repented, meaning David was not obeying Jesus' voice, God would have quit fulfilling the law of sin and death for David. God would have put David to sleep, killed him physically.
1 Corinthians 3:10 According to the grace of God which was given to me, like a wise master builder I laid a foundation, and another is building on it. But each man must be careful how he builds on it. 11 For no man can lay a foundation other than the one which is laid, which is Jesus Christ. 12 Now if any man builds on the foundation with gold, silver, precious stones, wood, hay, straw, 13 each man's work will become evident; for the day will show it because it is to be revealed with fire, and the fire itself will test the quality of each man's work. 14 If any man's work which he has built on it remains, he will receive a reward. 15 If any man's work is burned up, he will suffer loss; but he himself will be saved, yet so as through fire. NASU
Our David, for the year he was unrepentant he had built with wood. If he did not repent God would have put him to sleep. Our David would have entered heaven smelling of smoke. Our David was not known as an adulterer or a murderer when he arrived in heaven as God never imputed those sins to him.
The only commandments believers in Jesus have to obey for salvation are:
1 John 3:21 Beloved, if our heart does not condemn us, we have confidence before God; 22 and whatever we ask we receive from Him, because we keep His commandments and do the things that are pleasing in His sight. 23 This is His commandment, that we believe in the name of His Son Jesus Christ, and love one another, just as He commanded us. 24 The one who keeps His commandments abides in Him, and He in him. We know by this that He abides in us, by the Spirit whom He has given us. NASU
The commandments we are to keep for salvation are in verse 23. If we keep those commandments we abide in Jesus and He in us.
1 John 3:4 Whoever commits sin also commits lawlessness, and sin is lawlessness. 5 And you know that He was manifested to take away our sins, and in Him there is no sin. 6 Whoever abides in Him does not sin (see 1John 3: 24 above)
. Whoever sins has neither seen Him nor known Him.
NKJV
Anyone who abides in Jesus does not sin. They may be disobedient children, but God does not impute sin to disobedient children. (Romans 8: 10) We cannot commit lawlessness because, by God's word He, considers our flesh dead and the law does not apply to dead men.