That is why his faith was “counted to him as righteousness.” 23 But the words “it was counted to him” were not written for his sake alone, 24 but for ours also. It will be counted to us who believe in him who raised from the dead Jesus our Lord, 25 who was delivered up for our trespasses and raised for our justification (Romans 4:22-25 (ESV)
Who believe in him who raised from the dead Jesus our Lord. Again, faith in him, not in us. He was delivered up for our trespasses. He was raised for our justification.
The temptation that comes with anfechtung, with moral failure, is to despair that you are no longer worthy of the love of God. The temptation is to try then to prove yourself to God in some other way, to earn his favor back again. And that is precisely why it is a temptation. The temptation isn’t so much the adultery, the murder, the theft and other things showing lack of moral character. Those are just the surface temptations. The real temptation is apostasy that follows from fear and despair. “Lead us not into temptation.” Luther says that we pray here that we would not be led to believe falsely (legalism, and the desire to earn righteousness), despair, (which rightly ought to fall on the heels of any such legalism) and other great shame and vice, (which are often a reaction to despair and legalism). The one leads to the other and leads to the other. At the bottom of it all is not great shame and vice, by which we tend not to think of false belief and despair as being either, but actually false belief. And it lingers in the Old Adam of us all. It lingers especially hard where we think that “a Christian would never do that.” The devil knows how convincing our Old Adam can be in this. So he tempts us to do what we don’t think is forgivable, and when we fall he wants us to run to flee from God. But God knows our Old Adam too, and that is why he doesn’t rest our salvation on anything we manage to do before or after conversion, but in Christ himself, and it is why Christ gives us his body and blood every Sunday that we may know the promise is true, and receive his life.