Adam was afraid of God after he sinned, because he was a sinner, and his conscience hurt him. Sin causes fear in born again children of God. “The wicked flee when no man pursueth: but the righteous are bold as a lion.” (Prov. 28:1) If we know we are right, it gives us courage, but sin makes cowards of us.
If your neighbor’s dog comes into your yard, the moment he sees you, he runs for home, for he is in the wrong place. But when he gets in his own yard, he will meet you at the gate and challenge your right to enter. Adam had communion and fellowship with God so long as he was above sin, but when he fell under its power, by his own willful sin, he was no longer fit to face God; so when He came, Adam tried to hide.