The goal of God's law is to bless us by teaching us how to know Jesus through experiencing His character/nature by walking in His way, which is eternal life/salvation. In Psalms 119:29-30, David wanted to put false ways far from him, for God to be gracious to him by teaching him to obey His law, and he chose the way of faithfulness, so this has always been the one and only way of salvation by grace through faith. In Exodus 33:13, Moses wanted God to be gracious to him by teaching him His way that he might experientially know Him, and Israel too, in 1 Kings 2:1-3, God taught His way through His law, in John 17:3, eternal life is experientially knowing God and Jesus, and in Matthew 19:17, the way to enter into eternal life is by obeying God's commandments, so again this is the way of salvation by grace through faith. In Romans 1:5, we have received grace in order to bring about the obedience of faith, and in Titus 2:11-14, our salvation is described as being trained by grace to do what is ungodly, so God graciously teaching us to obey His laws for how to experience these aspects of His nature is itself part of the content of His gift of salvation.
In Jeremiah 9:3 and 9:6, they did not experientially know God and refuse to know Him because in 9:13, they had forsaken God's law, while in 9:24, those who know God know that he delights in practicing steadfast love, justice, and righteousness in all of the earth, so delighting in expressing and experiencing these and other aspects of God's nature through our obedience to His law is the way to experientially know Him, and Jesus, who is the exact expression of God's nature (Hebrews 1:3), which he expressed through his action by living in sinless obedience to God's law. In 1 John 2:4, those who say that they know Jesus, but don't obey his commands are liars, and in 1 John 3:4-6, those who continue to practice sin have neither seen nor known him. In Matthew 7:23, Jesus said that he would tell those who are workers of lawlessness to depart from him because he never knew them, so again knowing Christ is the goal of the law.
The Bible often uses the same terms to describe the nature of God as it does to describe the nature of God's law, which again is because it is God's instructions for how to express, experience, love, believe in, and testify about His nature, such as with it being holy, righteous, and good (Romans 7:12) or with justice, mercy, and faithfulness being weightier matters of the law (Matthew 23:23). God’s way is described as being aspects of His nature being righteous and just (Genesis 18:19), righteous, blameless, merciful, pure, humble, light, perfect, true, liberty, and gentleness (2 Samuel 22:21-37), and again there are many verses that describe God's law as being instruction for how to walk in His way, such as Joshua 22:5, Psalms 25:4-10, Psalms 103:1-8, Psalms 119:1-8, Isaiah 42:24, and Malachi 2:4-9, so again God's law was given to teach us how to express, experience, love, believe in, and testify about His nature.
Keeping the Sabbath holy in particular testifies that there is a Creator who created the world in six days, who rested on the 7th, who is holy, and who interacts with His creation to save His people out of bondage, while not keeping the Sabbath holy is denying the truth of these things. Some laws are less clear, so they essentially invite us to ponder what they are teaching us about God's nature, but if they did not reflect God's nature, then He would not have commanded them. The only way for any of God's laws to be abolished is if what they teach us about God's eternal nature is no longer true.