Shaikh Ibn ‘Uthaimeen:
The first condition.
Sincerity to Allah.
The person is sincere in his du’a.
Knowing that Allah is All-capable to answer his du’a.
Expecting the response from Allah.
The person’s aware of his situation when supplicating.
That he’s in the most dire need, rather in the most dire necessity for Allah.
(Believing) that Allah’s the One who answers the call of the one in distress if he calls to Him and removes the evil.
As for supplicating to Allah and he feels he is independent of Allah, and that he’s not in necessity and he asks Him like this, a custom only, then this is not likely to be answered.
That he avoids consuming haraam.
For surely, haraam is a barrier between a person and the answer of du’a.
Source: Fatawa Noor ‘alaa al-Darb (no. 324)