Isaiah 1:15
15 When you spread out your hands in prayer, I hide my eyes from you; even when you offer many prayers, I am not listening. Your hands are full of blood!
Isaiah 59:2
2 But your iniquities have separated you from your God; your sins have hidden his face from you, so that he will not hear.
1 Peter 3:12
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.
God doesn’t answer the prayers of sinners who have not turned away from their lustful, worldly desires. Isaiah tells us clearly that God wants us to turn away from such desires and do God’s will.
James 4:3
3 When you ask, you do not receive, because you ask with wrong motives, that you may spend what you get on your pleasures.
God tells us we can’t waste time praying for selfish desires. The reality is God isn’t going to answer your prayers unless you are 1) a believer, and 2) praying for something within God’s will. Those who say they are Christians but have never accepted Christ as Lord of their lives are not likely going to be heard. Those who do not even claim to be Christian have no chance of being heard. If their prayers are answered, then it just happened to match God’s will, luckily.