Romans 7
Or do you not know, brethren (for I speak to those who know the law), that the law [a]has dominion over a man as long as he lives? 2 For the woman who has a husband is bound by the law to her husband as long as he lives. But if the husband dies, she is released from the law of her husband. 3 So then if, while her husband lives, she marries another man, she will be called an adulteress; but if her husband dies, she is free from that law, so that she is no adulteress, though she has married another man. 4 Therefore, my brethren, you also have become dead to the law through the body of Christ, that you may be married to another—to Him who was raised from the dead, that we should bear fruit to God.

To be free from the law, is freedom from sin. The law shows us where we fall short. When we are in Christ Jesus and born again, we no longer fall short according to the law.

So in chapter 6 Paul explains being dead to sin.
Now Paul explains being released from the law. Both of these events happen because we are in Christ Jesus and we died to our old self.