Praise be to Allah.
If you eat haraam food, this will cause your du’aa’ to be rejected, hence it was reported in a hadeeth
The Prophet (peace and blessings be upon him) said: “Allaah is Good and does not accept anything but that which is good. Allaah has enjoined upon the believers that which He enjoined upon the Messengers.” Allaah says (interpretation of the meaning):
“O you who believe (in the Oneness of Allaah — Islamic Monotheism)! Eat of the lawful things that We have provided you with, and be grateful to Allaah”
And He says (interpretation of the meaning):
“O (you) Messengers! Eat of the Tayyibaat [all kinds of Halaal (lawful) foods which Allaah has made lawful (meat of slaughtered eatable animals, milk products, fats, vegetables, fruits)] and do righteous deeds”
Then he (peace and blessings be upon him) mentioned a man who travels a great deal and becomes disheveled and covered with dust, who raises his hands to the heavens (and says), ‘O Lord, O Lord,’ when his food is haraam, his drink is haraam, his clothes are haraam and he has been nourished with haraam, so how can he receive a response?
(Narrated by Muslim in his Saheeh).
The meaning is that it is unlikely that his du’aa’ will be answered. But salaah (prayer), which includes du’aa’ and other things, will still be accepted, in the sense that it serves to fulfil his obligations, and he does not have to repeat it. What was narrated was that it is the one who drinks alcohol whose prayer will not be accepted for forty days.