David says:
Oh that my ways may be steadfast
in keeping your statutes!
Then I shall not be put to shame,
when I regard all your commandments. Psalms 119:5-6
Paul says:
The very commandment that promised life proved to be death to me. For sin, seizing an opportunity through the commandment, deceived me and through it killed me. So the law is holy, and the commandment is holy and righteous and good. Did that which is good, then, bring death to me? By no means! It was sin, producing death in me through what is good, in order that sin might be shown to be sin, and through the commandment might become sinful beyond measure. Romans 7:10-13
The purpose of the law is to show us our sin. To show us that we need redemption, and that without that redemption, we have no hope whatsoever of a covenant with God.
Again, David says:
Oh that my ways may be steadfast
in keeping your statutes!
Then I shall not be put to shame,
when I regard all your commandments. Psalms 119:5-6
John says:
And now, little children, abide in him, so that when he appears we may have confidence and not shrink from him in shame at his coming. 1 John 2:28
How do we avoid being ashamed at his coming? John says in the very next verse.
If you know that he is righteous, you may be sure that everyone who practices righteousness has been born of him. 1 John 2:29
We avoid shame by being righteous. How do we practice righteousness? Paul told us previously!
So the law is holy, and the commandment is holy and righteous and good. Romans 7:12