When I play hide-and-seek with my granddaughters, I will show them a new hiding place. Then, when it is my turn to find them, they will go to the place I just showed them.
That is what it's like when we try to hide from God. In the Garden of Eden, God called out to Adam, "Where are you?" But God knew exactly where Adam was. And He knew exactly what Adam had done. God wasn't asking Adam this question because He was clueless and looking for information.
By asking "Where are you?" God was saying, in effect, "Well, Adam, how is it going? How did that work out for you—the whole sin thing? Was I right on this, or was I wrong? How are you feeling about it? Is this good? Did I tell you the truth, or did the Devil lie to you?"
God wanted Adam and Eve to confess what they had done so He could set it right, because God cannot forgive a sin that has not been confessed.
The Bible says in 1 John 1:9, "If we confess our sins, [God] is faithful and just to forgive us our sins and to cleanse us from all unrighteousness." What does it mean to confess our sin? The word confess used in this verse means "to agree with."
And what is God's opinion of sin? He hates it. What else does God think of sin? It offends Him. So we have to see sin that way, stop rationalizing it and justifying it, and start saying, "God, Your opinion of sin is right. I agree with You. I hate it. It was wrong for me to do. I am sorry for it." Until we come to this conclusion about our sin, it will separate us from God.