Observation: Apparently being credited righteousness is the same thing as forgiveness. When you compare the start of Romans 4 with the quote from David it is clear that when God forgives us He is crediting us with righteousness and vice versa.
Question: Why would we rejoice in affliction? The answer seems to be that affliction causes us to endure or persevere, when we persevere God changes our character, when God changes our character we have hope because it is evidence that God is really at work in us and thus we are saved.
Application: Abraham hoped against hope. How can I maintain hope regardless of circumstances because I know who God is?
Prayer: God, I praise You that though You would be just to punish my sin, You chose to offer me forgiveness even at the cost of Jesus’ blood. I praise You for being the One who justifies me and yet for being just to punish my sin in Jesus as I rightfully deserved.