There is no doubt that a person’s sins come between them and the response to their du’a. If we are making du’a for long periods of time without receiving a response, we should examine our own actions closely. Perhaps there is something that we are doing that is preventing our du’a from being answered?
We see this explained in the following hadith:
“The skies of the heavens are opened in the middle of the night, and a crier calls out: Is there any person making du’a, that he be responded to? Is there any that asks, that he be given? It there any that is in straightened circumstances, that it be lifted from him? And there is no Muslim that makes a du’a (at this time) except that Allah will respond to him, except for a fornicatress that is striving (to sell) her private parts, or a tax-collector”. (Recorded in At-Tabarani)
In this hadith, we are informed that every single Muslim that makes a du’a at this time will be responded to, except a prostitute that is selling her body, and a tax-collector that is taking other people’s money unjustly. So these two sins are the cause of their du’as being rejected.
Once, Sufyan al-Thawri was asked: “Why do you not make du’a (for such and such a matter)?” He responded, “Leaving sins is, in and of itself, du’a“, implying that, just as sins come between a person and his du’a, likewise leaving sins makes the path of response easier. And Allah knows best.