We pray because prayer is crucial in determining God's will.
I have said many times, I try to only do what I see my Father doing. So, it is in prayer.
I offer no prayer for healing, unless my Father says, healing is what He wants. It is not always, as many think, that healing is His will.
Ecclesiastes 31 There is a time for everything, and a season for every activity under heaven: 2 a time to be born and a time to die
But, do we always pray God's will or do we pray a selfish prayer.
To pray for something to happen is to say to God that you know better than Him! It is to say that you do not agree with the course of events that God has laid out. It is ignorant, misguided, confused but most of all arrogant. Asking God to act at a time when God knows it is not the right time to act is praying against His will. If it is right, God will have already planned to do it. If it is wrong, God won't do it. Your prayer will not change these facts. To pray like this is to oppose God, to harass Him, to make a statement that you think you know better! It is insolent and arrogant.
Jesus said "Get thee behind me, Satan!" to an apostle who thought he knew better than God's plan (even though the apostle was bemoaning suffering!)... by trying to sway God's mind through prayer, YOU are behaving in the same way as that apostle! No matter how good your intentions are, your own master , would call you Satanic for it! Think about what it means to pray hope or wish for things, you might find you're not doing what your God wants you to be doing! Prayer should be, first, to find out the will of God.
Of course if a desire goes against Scripture, or if God has said no to it in a clear and resolute way, praying for it is disrespectful to God. I should merely pray that God will give me a heart to accept the situation and persist in that prayer until my heart changes. But when God hasn't plainly said no, I should feel not only freedom but a mandate to continue raising my request to him until he gives an explicit answer.
Isaiah 59:2 (New International Version)
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 John 5:14-15 (New Century Version) 14 And this is the boldness we have in God's presence: that if we ask God for anything that agrees with what he wants, he hears us.15 If we know he hears us every time we ask him, we know we have what we ask from him
Admittedly, when no answer seems to be forthcoming, we can feel uneasy continuing to raise a request to God. We worry that we're pestering God and praying against his will. We should remember, though, that prayer not only has an effect upon God but upon us. Any prayer that I make--even one for a purely personal desire--has the effect of putting me in communication with God. A channel is established through which he can influence my thoughts and feelings.
Listen for the will of God. Be cautious of your own desires.
Proverbs 3:5 (New International Version)
Trust in the LORD with all your heart
and lean not on your own understanding.
Because our understanding is flawed, selfish and finite .