Nothing given to you is a rule, a law, a have to do.
When you were a child, your parents set down structures, rules, consequences, rewards. But when you became an adult, you were free from those restrictions and you were free to decide what to continue with and how to apply it, if it was important.
You had a bedtime, when you were young. Now as an adult, you don't have a bedtime but you know because of responsibilities that it helps to set yourself a bedtime. No one comes to you when it is past your set bed time and tells you that if you don't get to bed there will be consequences. It doesn't mean that there aren't consequences.
When you are a child, you are not allowed to snack during the day. When an adult, you do as you want. But if you don't exercise self control, you could end up paying the consequences.
When you are a child you directed to be good to each other and directed what you should have done when you make a mistake and sometimes punished. If you lash out in anger and hurt someone for example. As an adult, if you do this, there could be physical repercussions involving the legal or judicial system.
When you are a child, you have to ask to go somewhere and you have a curfew. When an adult, you go where you want and come home when you want. But you know better than to go some places and be with some people and be out at certain times. So you don't do it.
When you were a child, at bedtime, you spoke a specific prayer, and one at dinner maybe. At church you were maybe led to prayer by repeating someone. As an adult you began to speak to God the utterances of your heart. When you were a child, you went to your parents to discuss your emotions, thoughts feelings, needs. As an adult in Christ, we turn to our own TRUE father.
All of this is like the law of God.
But in reality, there are spiritual repercussions.. what you give comes back to you. even more than you give. It is a spiritual law.
But even more than that, one step further and you understand that not only what you to to others you end up doing to yourself but also to God. We are all connected and ware are all connected to Him.
The purpose of the rules were to set a precedent, a foundation, if you will, an idea or path.
added insight 1/18/2020
these rules were fences to keep you safe and guide you and teach you until such a time as you were mature enough to walk in them yourself. This is true of physical maturity and spiritual maturity alike. So now you don't need the fences.. you have the freedom.
But even further than the physical laws and the spiritual laws God set in place a creation, when you walk in the spirit, there is no need for the law. The laws are written on your heart. There are things you just don't do when you walk in the spirit... God takes it from you and you just don't do them. The closer you get to HIM, the less you do that is contrary to what HE does. When you walk in the spirit, the negative spirits no longer have access to you unless you allow them to. We are not under the law of blessings and curses, we are under the law of Grace. So when we do wrong, which does happen (it just happens less and less), God is a faithful God and we need only ask forgiveness (if we really mean it). And that action will be removed from our book.. the books written about us. So if it is not on the book, then the curse that normally accompanies violations of the law cannot come. It has no power over us. This is not license to sin, it is freedom from sin.
The law of sin and death is a spiritual law for those walking in the flesh and not the spirit:

https://www.biblegateway.com/passage/?search=Romans+8&version=LEB
1 What I am saying is that as long as an heir is underage, he is no different from a slave, although he owns the whole estate. 2 The heir is subject to guardians and trustees until the time set by his father. 3 So also, when we were underage, we were in slavery under the elemental spiritual forces of the world. 4 But when the set time had fully come, God sent his Son, born of a woman, born under the law, 5 to redeem those under the law, that we might receive adoption to sonship. 6 Because you are his sons, God sent the Spirit of his Son into our hearts, the Spirit who calls out, “Abba, Father.” 7 So you are no longer a slave, but God’s child; and since you are his child, God has made you also an heir.