Supplication is one of the most powerful tools for driving away evil, and
btaining that which is needed; however, its effect may be absent if there is
weakness in the self - such that the supplication could be disliked by
Allah (Subhanahu Wata'ala) ; if it includes any injustice, or due to the
weakness of one's heart, not being devoted to Allah ~ at the time of supplication.
Hindrance may also be due to eating that which is Haram
(unlawful in Islam) or to the accumulation of sins on the
heart, or to the dominance of one's desires upon the self.
The Prophet ~ said: "Supplicate to Allah when you are
assured of being answered, and know that Allah does not
answer a supplication which comes from a careless and
inattentive heart." (Sunan Tirmidhi - Chapter of Supplication and Musnad Ahmad 3/451 )
Extract from Spiritual Disease and its Cure
by Ibn Qayyim