If God was to answer all our questions, we would be living a care free life, and that would be a disaster in this world. We as the children of God we have to go through struggles, pains and sufferings in this world so that God can make himself known. Sufferings and pain are what get us closer to God, because it is that pain that we go through that will make us go on our knees and pray, the same pain and suffering will put us in a place of joy and peace. This is when God's name is exalted and glorified. So when God doesn't answer our prayers he knows why he does that. Some of the reasons why he doesn't answer isbecause, it is not yet time for you to have whatever your asking for, or God already knows why that whatever yoir asking for is not good for you or it will harm you, so he keeps it away from you so that you don't get hurt.