Some messages on prayer are about what we need to do in order to ensure an answer to prayer. In other words, they describe things we can do which will assure us of getting our answer or at least improve our chances of getting what we want. Some people give the impression that if we do these things then God will have no way to refuse us. For example, getting someone to 'agree' with us, getting a lot of people to pray for us, fasting and praying, making a vow to God in return for His answer, praying the whole night, or sowing some 'seed money' are supposed to make sure that we get what we want. If this is true, isn't this the same as forcing God to do what we want? Do you think God is someone who can be forced?
No. This is totally wrong. Is God an inanimate force like electricity which will start working if you make the proper connections? No, He is a living Person who thinks, feels and makes His decisions. He is all powerful, all knowing, all wise, present everywhere and sovereign, and no one can make Him do anything. But the arrangement He has made with us when He created us, and especially after we have become His children, is that we can pray to Him for whatever we want (Jn.14:13). This prayer is not a demand or a claim we make on Him, but a mere request coming from a child to the Father (Php.4:6). As our Father, it is entirely up to Him to decide whether to give it to us or not.
If God were to give us whatever we asked, wouldn't He be a foolish father? Many earthly fathers are foolish like that, and they end up spoiling their children. But our Heavenly Father knows what we really need, even when we don't, and He will grant to us only things that He thinks are good for us. John makes it clear that only when our prayers are according to God's will that we can have the assurance that we will receive an answer (1Jn.5:14,15). Some people try to prove that God answers all our prayers by saying that no is also an answer. But that is just playing with words because when we ask God for something we think He has answered it only when He gives what we have asked for. If He says no, then He is not giving us what we ask for! (If our prayer was to ask for guidance and He answers no, then it is an answer.)
So, in order to know what we should pray for, for which we can expect an answer, we need to get to know what kind of a person God is. The more we understand Him and His ways, the better we can know what to pray for. That is why God has given us His word to learn about Him.
Once we understand that God is the one to make the decision, and we know that He loves us dearly and He knows what is best for us, then it becomes easier for us to accept when there is no answer. Our limited minds may not understand the reasons why He has said no, but we can believe that He has our best at heart, and that He is able to turn even the evil that happens to us for our eternal good (Ro.8:28,29). Then we can become more mature in our prayers.