Prayer is a terribly misunderstood subject.
Why? Because we often form beliefs based on partial knowledge of Scripture. Let me show you what I mean:
Matthew 7:7 says ask and receive.
John 14:14 says ask anything and God will do it.
John 15:7 says ask and receive if you remain in God and His Word.
John 15:16 says ask and receive as you bear fruit for the Kingdom.
James 4:2-3 says you don't receive answers because you don't ask or because you have selfish motives.
1 John 3:21-22 says you'll receive what you ask in prayer if you are obeying God and have a clear conscience.
1 John 5:14-15 says ask according to God's will and receive.
If we only know the first two verses we'll assume God gives us anything we ask in prayer. When we know all passages, we understand God answers prayers of sincere Christians who pray according to His will.
It's critical that we study the full message of Scripture.
For a more thorough look at this subject, check out my 5 minute Bite Size Bible Study on this concept, Pieces Parts and view my insights on the Pieces Parts study HERE.