Now we know that whatever the law says, it says to those who are under the law, so that every mouth may be silenced and the whole world held accountable to God. Therefore no one will be declared righteous in God’s sight by the works of the law; rather, through the law we become conscious of our sin. Romans 3:19-20
Many people have asked through the years, “why did the law exist in the first place?” The short answer is in this verse (theologians have been studying the longer version for centuries, and it’s why Romans is such a complex book). Simply put, we became aware of sin through the law. The law here is considered the “Mosaic Law,” essentially what Moses brought down from Mt. Sinai (which would include the Ten Commandments). If you only had the Ten Commandments to go on, though, it would still be enough to convict you of sin. Jesus himself said that we failed to keep even those ten laws because we broke those laws in our hearts.
The Ten Commandments are a great starting point for the law because, as Paul wrote earlier, many of those laws have already been written on our hearts. We know them without actually needing to read them on a stone tablet or in a Book. For instance, we know that it is universally wrong to murder someone. We know that already and probably every culture on the planet knows that. We also know that when we break that commandment in our heart that it is wrong too. Again, most people know that already (but some after years and years of ignoring it probably suppress it and find ways of justifying the hatred for someone else – the “murder” in your heart).
The written word, therefore, made that sin “official” so to speak. It was already in our hearts; it just needed to be written down.
As Paul progresses through each chapter, we continue to see a simple thread throughout: we are aware that we sin, and because of that we are without excuse.