Sometimes we feel we're no longer close to God not because God left us but because our sins created a barrier between us and God. The bible teaches us that sin, disobedience and hate can create a spiritual distance between human and God. If we become too obsessed with worldly things, it will easily separate us from God. God is ready to forgive us anytime we come back to him.
Another thing that will make us far from God is our disobedience, and during the time of trial we may lose faith and it will look as if the devil won. In such moments, emotions like fear, doubt, or disappointment can cloud our faith. Many faithful people in the Bible, including David, expressed feelings of abandonment, yet God was still working in their lives.
James 4:8 reminds us, “Draw near to God, and He will draw near to you,”