God can forgive any sin! Psalm 51 teaches us that we can always go to God and ask for His forgiveness. God can and will forgive your sin. Like David, we can ask God to give us a deep cleansing from within (Psalm 51:7) by cleansing our hearts and spirits. Good and godly lives can come only from a clean heart and spirit from God. So, ask God for a deep and thorough cleansing to create a pure heart and spirit within you.
Although God forgives our sins, God does not always remove the natural consequences of our sin. Sadly, David's life and family suffered damages as a result of his sins (see 2 Samuel 12:1-23). Yet, God restored to David the joy and inner happiness of a right relationship with God after his plead for mercy and forgiveness.