There is no doubt that Martin Luther was tormented regularly by sin's accusations against him, especially in his early years as a monk. As mentioned previously, I share this struggle from time-to-time, which quite honestly was part of the initial enticement to read Luther. Fortunately, Luther received some wise counsel from his Father Confessor, Johannes von Staupitz, who repeatedly pointed him back to the cross. Luther ran with this advice and repeated it to his hearers again and again.
Luther asks, "What should you do when the thought of death frightens you and your conscience bothers you?"
Continue to live in Christ. You must believe that you can accomplish nothing by your own works and that the only way is through Christ's righteousness. John 6.29 says that the work of God is believing in the one he has sent. So when Nathan corrected David, and David confessed his sin, Nathan replied, "The LORD has taken away your sin. You are not going to die" (2 Sam 12.13). David simply lived in grace. He didn't even think about trying to satisfy God with his works. When Nathan said, "The LORD has taken away your sin," he was proclaiming the message of grace. And David believed it.
After Adam sinned, he could do nothing that would bring him into a state of grace. But God said that one of his descendants would crush the serpent's head (Gen 3.15). It was by this promise Adam was made alive. Because he believed in this word, he was saved and justified without any works. Our nature struggles fiercely against being saved without our works and tries to deceive us with a grand illusion of our own righteousness. So we may find outselves attracted to a life that merely appears to be righteous. Or because we know we aren't righteous, we may be frightened by death or sin. Therefore, we must learn that we should have nothing to do with any way of becoming righteous except through Christ alone.
(from Faith Alone: A Daily Devotional /LW 30:263)