If we confess our sins, he is faithful and just and will forgive us our sins and purify us from all unrighteousness.-1 John 1:9
The only condition that God places on forgiveness from your sins is that you confess your sins to him. Why must we confess our sins to God if he already knows what we have done? Because by confessing we are admitting that we have done wrong and that we are in need of forgiveness. God is more than willing to forgive our sins and to purify or cleanse us from all things that are keeping us from him. All that is required of you is to ask and then walk in obedience to God.