James 5:16 Therefore confess your sins to each other and pray for each other so that you may be healed. The prayer of a righteous person is powerful and effective.
Sin separates us from God. Some have taken this Scripture to mean that God will not hear the prayer of the sinful man. Judge for yourselves from the following scriptures.
John 9:31 We know that God does not listen to sinners. He listens to the godly person who does his will.
1 Peter 3:12 For the eyes of the Lord are on the righteous and his ears are attentive to their prayer, but the face of the Lord is against those who do evil.
I believe God does hear his prayers but will not answer until the sinful man repents.
God is far from the wicked because the wicked has rejected or walked away from God, not the other way around. God does answer the righteous quicker as you can read in in the next Scripture.