God answers prayer, but not always our way. He is rarely rushed or in a hurry, as is evident in His Creation: It takes Him time to make a baby, a flower, a tree, a sunset--or even a blade of grass. You can't rush God. You've got to wait till it's GOD'S time. Sometimes God delays answering prayer until you have learned the lesson He is trying to teach you. Or perhaps He is waiting for the circumstances to be ready for the result that He wants to bring. Take for example the man in the Bible who was blind from birth: He had had to be blind all his life, so that everybody would KNOW it, and so that when Jesus came along one day and marvelously healed him, God would be glorified. (See John 9.) It may sometimes take years before you know why God didn't answer prayer as you thought He should, or right when you asked Him to, but the time will come, and you'll know God was right! Wait on the Lord!
The greatest darkness is just before dawn, the greatest desperation is just before Salvation! The greatest hopelessness attacks just before rescue! So never doubt for a moment that God is going to answer--And He will! Trust Him and thank Him for the answer--even if you don't see it immediately! You'll be glad you trusted Him tomorrow!