2 Samuel chapter 12 looks at three ways God moves us out of captivity and toward freedom: First, God moves us toward freedom by confronting our sin. Second, God moves us toward freedom by exposing our sin so we can see it clearly. When we ignore God's commands, we act as if we know better than Him and reject His provision. We need to spend time in God's word and let it convict us so we can see our sin clearly and confess it.
Finally, God's grace prevails over our sin. When David owned his sin and confessed, "I have sinned against the Lord," Nathan immediately replied, "The Lord has also put away your sin; you shall not die." David deserved death under the law, but God put his sin away. Ultimately, Jesus bore the wrath meant for us on the cross so that we could be made alive in Him. Salvation is a gift of grace to be received, not earned.