Abu Hurairah reported,

The Messenger of Allah ﷺ said, "People, Allah is pure and accepts only what is pure. Allah has commanded the believers with what He commanded the messengers, saying, 'Messengers, eat from the good things and do righteous deeds. Indeed, I am Aleem of what you do' [Muminun 23:51], and He said, 'You who believe, eat from the good things We have provided you and be grateful to Allah, if it is Him you worship' [Baqarah 2:172]."Then he mentioned a man who travels far, disheveled and dust-covered, stretching out his hands to the sky, crying, "Lord, Lord!" Yet his food is unlawful, his drink is unlawful, his clothing is unlawful, and he has been nourished by what is unlawful. So how can his prayer be answered?

Azami 10946

Sahih

عن أبي هريرة قال

قال رسول الله ﷺ: أيها الناس إن الله طيب لا يقبل إلا طيبا، وإن الله أمر المؤمنين بما أمر به المرسلين فقال: {يأيها الرسل كلوا من الطيبات واعملوا صلحا إني بما تعملون عليم} [المؤمنون: ٥١] وقال: {يأيها الذين ءامنوا كلوا من طيبت ما رزقنكم واشكروا لله إن كنتم إياه تعبدون} [البقرة: ١٧٢] ثم ذكر الرجل يطيل السفر أشعث أغبر، يمد يديه إلى السماء، يا رب يا رب، ومطعمه حرام، ومشربه حرام، وملبسه حرام، وغذي بالحرام، فأنى يستجاب لذلك.

الأعظمي 10946صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Rulings on supplication
Section
Those whose supplication is not answered
Numbering
Jami al-Kamil 10946 (2nd edition)
Azami 10946