A question often posed is why don't all prayers get answered?
I feel the a large reason to this is people treat God like an impersonal force instead of a person - something like a math equation, where if I do "this, this, and this", then I'll get exactly the same result because someone else did it too.
This belief is often why some people get frustrated when they, for example, pray for a healing and don't get it, but someone they know with the same condition does.
God is a divine personality, and a good, good Father to us. And just like a good parent raises their children, He will say yes to some, no to others, and make others wait a while, because we cannot possibly ever know how the means justify the ends, as we cannot see the beginning and the end like He can, and it doesn't mean He loves any one of us more or less.
We have to consider a lot of aspects of our life and how it would affect others and ourselves, but as naturally centered beings, we can never possibly know how everything works out, and quite frankly, I enjoy looking looking back and seeing how all the dots got connected, because it gives the glory to God and shows you how He held your hand the entire way.
With that in mind, we must also consider the Word and how we apply the commands of Christ to our life. Are you trying to live sin free? Are you practicing repentence to achieve salvation. Are there areas in your life that need to be cleaned up, such as addictions or wrong-doings to others?
From another angle, you can take this parenting analogy for example - a child, who is 11, may ask to stay up late, and the parent will tell him yes more often than not, because he has shown the ability to still wake up early and function normally.
Now another child from the same parent, who is 8, may ask the same question, and the parent may more often say no, because he has not shown the ability to still awake early and function normally on less sleep, and may fight to sleep longer, especially if early plans were made.
It doesn't mean the parent loves either of them any more or less - it simply means they are a good parent and aware of each child's true needs, despite what they may request of them. Focus on the Word - it guides our life and keeps us out of darkness.
We hear God’s Word through His Spirit, and in times of prayer; and we also hear His word through the Scriptures we read.
Keep your mind fixed on the word of God, it will continually keep you safe, keep you encouraged, and keep you wise so that you will always be wary of the ways of the enemy.