I really believe that confession as requested of us in 1 John 1:9 for the forgiveness of sins is best made to another human being.
I just wonder, how can you confess to God who already knows. Yet if confession to God is all you have in you, I suggest you try. Lord forgive my sins … .
Don’t let me dissuade you or cause you to give up. If your confession is sincerely seeking forgiveness from God it includes the desire and intent to change and no longer walk in sin.
In Matthew 9:12-13 KJV Jesus said … They that be whole need not a physician, but they that are sick.  … I am not come to call the righteous, but sinners to repentance.
Change and repentance walk hand in hand.
Proverbs 28:13 KJV says, He that covereth his sins shall not prosper: but whoso confesseth and forsaketh them shall have mercy.