There's bad news, and good news. The bad news is, when David tried to hide his sin, God exposed it to the entire nation. The good news is, when he repented of his sin, God forgave him and wiped his record clean.
What God did for David, he'll do for us. All we have to do is pray, 'Cleanse me from my sin...Create in me a clean heart, O God' (Psalm 51:2, 10 NKJV). How does God respond to a prayer like this? Here's what he said to Solomon, David's son: 'If you walk before me as your father David walked, in integrity of heart and in uprightness, to do according to all that I have commanded you, and if you keep my statutes and my judgements, then I will establish the throne of your kingdom over Israel forever, as I promised David your father, saying, "You shall not fail to have a man on the throne of Israel"' (1 Kings 9:4-5 NKJV).
We may feel that because of our sin we're beyond hope and redemption, that we've given up the opportunity to be useful to God and to fulfil our destiny. But this isn't true! We can recover. We can be restored. We can be forgiven. We can regain our integrity. We can be healed and become whole again.
So what now? Today, know that God can forgive and restore you, no matter your past. All you have to do is ask him. It's his heart's desire to do so.