There are many reasons why prayer is not answered. God is by no means obliged to answer every prayer for every person. The Bible tells us that sometimes prayers are not answered because we nourish and cherish sin in our hearts. Again it tells us that it is because we desire things to consume ourselves, in other words, selfish reasons. But most of all, you should remember that God promises to answer prayers for certain things, not just anything. He will answer the prayer of any sinner who prays for pardon in the name of Jesus (Romans 10:13). He will give Himself in His fullness to any believer who sincerely desires His fullness (Luke 11:14). He promises to cleanse all the sins of any child who comes to Him confessing his sins (1 John 1:9). He will give wisdom and spiritual insight to those who acknowledge their lack and who sincerely desire such wisdom (James 1:5). If you are a fully yielded Christian, and commit your whole life to Him, He promises to give you even the whole desire of your heart (Psalm 37:4, 5). This is a simple formula, but it will encourage you to pray according to His will. Then you will not need to feel that God ignores your request.
Of course, there are many other prayers that God answers that are not mentioned in the Bible—if we pray according to His will in Christ’s name with a motive to glorify God.
From Billy Graham’s “My Answer” (1960 compilation of “My Answer” columns)