He acknowledged his sin, it was always before him. The reason he felt so bad was because the sin he had committed was against God. He said that if God washed him he would be whiter than snow. Then he asked God to create a clean heart within him and renew a right spirit in him. He pleaded with God not to cast him away from His presence or take His Spirit from him. David was truly, truly sorry. He was so afraid that God would withdraw from him and he knew that without God he was nothing.
God knew that David was sorry and if you were to read 2 Samuel 12:13 you will see that God did forgive David. Maybe you are born again and you have done something that has made you feel guilty about approaching God because even though no one else knows, God knows. He won’t leave you, He won’t forsake you and He will forgive you. The price has been paid for your sin and nothing can separate you from God. Romans 8: 38-39. Go to the Lord and allow Him to minister to you today. He will restore you. You are secure in Him.