Explanation
The Prophet (may Allah's peace and blessings be upon him) informed that Allah is Good, Holy, Exalted far above deficiencies and shortcomings, and possesses the attributes of perfection. He accepts only the deeds, statements, and beliefs that are good, i.e., those that are sincerely devoted to Allah and that comply with the Prophet's guidance. No attempt should be made to get closer to Allah except through this. One of the greatest means to make the believer's deeds good is to eat good and lawfully earned food, and this, consequently, purifies his deeds. For this reason, Allah has commanded the believers with what He commanded the messengers about consuming what is lawful and offering righteous deeds, as He says: {O messengers, eat from the lawful things and act righteously, for I am All-Knowing of what you do.} [Surat al-Mu’minūn: 51] And He says: {O you who believe, eat of the good things We have provided for you.} [Surat al-Baqarah: 172]
Then the Prophet (may Allah's peace and blessings be upon him) warned against consuming what is unlawful, which invalidates deeds and makes them unacceptable despite utilizing the apparent means of acceptance, such as:
First: Traveling for a long period to perform acts of obedience like Hajj, Jihad, maintaining kinship ties, etc.
Second: Having disheveled hair because of not combing it, with the changed color of his skin and clothes because of dust, so, he is helpless.
Third: Raising his hands to the sky in supplication.
Fourth: Imploring Allah with His names persistently: O Lord, O Lord!
Despite the existence of all these means of answering the supplication, he receives no response because his food, drink, and clothes are unlawful, and he is nourished by the unlawful. It is very unlikely for someone with such a description to have his supplication answered, and how could it be answered?!