Lutheranism and the Reformed tradition both come directly out of the Protestant Reformation and have much in common, at least historically. Not the least of these commonalities are the doctrines of justification by faith alone and the final authority of Scripture. Yet, there are also differences between these two traditions, one of which is how the respective communities distinguish law and gospel.
In teaching if not in practice, Lutheranism tends to draw a sharp distinction between law and gospel in the whole of the Christian life. God's law is almost always seen as a threat even though Lutherans call believers to live by the Ten Commandments. Reformed thinkers, however, traditionally view God's law more positively. Yes, the Reformed tradition has said that we must sharply distinguish law and gospel—but only in regards to our justification. That is, God's law and God's gospel offer two alternative ways of securing a righteous status before the Lord. We can be justified by His law if we keep His commandments perfectly, or we can be justified by faith in the gospel on account of Jesus’ perfection. Of course, since no sinner can keep God's law flawlessly, the gospel is the only means by which we can be justified. John Calvin comments on Galatians 3:12 that "the contradiction between the law and faith lies [only] in the matter of justification."
Law and gospel are not opposed elsewhere, even in our sanctification, the process by which we live out our gratitude for God's gracious salvation. Jesus Himself calls us to obey the commandments, not to earn our place in heaven but to thank the Lord for providing us a place in heaven through Christ Jesus our Savior (Matt. 5:19). Thanking our Creator for His redemption involves the people of God making an effort by His Spirit to live holy lives. This was true of the Israelites, who were given the Ten Commandments after their rescue from Egypt (Ex. 20:1–17). It remains true for us today, for in Christ we have been saved unto good works (Eph. 2:8–10).
Consequently, thanking God for our salvation does not consist merely in getting used to our justification, although we must never forget that we stand before God unafraid based on His grace alone. True gratitude consists in our efforts to live godly lives according to God's law (Heidelberg Catechism, Q&A 86).
Answer 86 of the Heidelberg Catechism emphasizes that we do good works because the God who justifies us also gives us His Spirit to conform us more and more to the image of Jesus Christ. Our Lord saves us from His wrath in order that we might serve Him according to His law, but we cannot serve Him unless we walk by the Spirit of God. The Holy Spirit empowers our obedience to God’s law, and we must ask Him daily for help that we might obey our Creator.