I once paid $1 for an antique oak desk. It had been painted multiple times. It was full of grease, nicks and stains. But when my dad and I restored it, the wood shone through. It was beautiful, but it still had every nick and flaw.
David had taken Bathsheba as his own, killing his friend, her husband. And he was caught in his sin. He could never go back to the way things were before, but he prayed for God to renew and restore him.
Just like that desk, David's outward circumstances hadn't changed. But he was cleansed and restored to joy. When we come to Jesus, He transforms our hearts. We still have the stains and scars of our lives, but He uses them to create beauty in our lives. They become part of our story, as we share Jesus with other hurting people.
So ask Him today to "create a clean heart" and "renew a right spirit" in you. He will never leave you. Instead He will restore you to joy.