I came across an excellent blog post quoting Martin Luther, on what to do when feeling accused by the Devil, and guilt for your sin. I found this paragraph particularly helpful:
“When the devil throws our sins up to us and declares we deserve death and hell, we ought to speak thus: “I admit that I deserve death and hell. What of it? Does this mean that I shall be sentenced to eternal damnation? By no means. For I know One who suffered and made a satisfaction in my behalf. His name is Jesus Christ, the Son of God. Where he is, there I shall be also.”
Luther: Letters of Spiritual Counsel, trans. and ed., Theodore G. Tappert, 1960, (Vancouver, BC: Regent College Publishing, 2003).