I often find that people supplicate with certain prayers and have their prayers answered, and they couple their supplication with their neediness and turn towards Allah, or a good deed they carried out that caused Allah to respond to this supplication out of appreciation for this good deed, or they happened to supplicate at a time in which it is more likely to be accepted, etc. So, his supplication was answered because of this.

One might think that the secret was in the specific wording of his supplication, and might therefore approach it simply from this angle while ignoring all of these other things that were coupled with it by the person supplicating. This is like someone who uses beneficial medicine at its proper time and in the proper manner and it benefits him as a result, and someone else thinks that simply using this medicine regardless of these other factors will bring about the same benefit. This person is wrong, and this is where many people fall into error.

And supplications and prayers of refuge are like weapons, and a weapon is only as effective as the person using it, not just based on how sharp it is. So, as perfect and flawless a weapon is, as strong as the arm that is using it, as much as there is nothing to nullify its effectiveness – the more damaging it will be against the enemy. And whenever one of these three elements is absent, the effect will be held back.

So, if the supplication itself is not good, or the one supplicating does not have both his heart and tongue present when making it, or there is some element present to prevent it from being answered, it will have no effect.

–  By Ibn Qayyim Al-Jawziyyah
–       Ad-Da’ wad-Dawa’; p. 40-41