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, for He said, 'Messengers, eat of the good things and do righteous deeds. Indeed, I am Aware of what you do' [Muminun 23:51], and He said, 'You who believe, eat of the good things We have provided for you' [Baqarah 2:172]."Then he spoke of a man who travels far, dishevelled and covered in dust, stretching out his hands toward the sky and crying, "My Lord, my Lord!" Yet his food is unlawful, his drink is unlawful, his clothing is unlawful, and he has been nourished on what is unlawful. So how could such a man be answered?
قال رسول الله ﷺ: أيها الناس إن الله طيب لا يقبل إلا طيبا، وإن الله أمر المؤمنين بما أمر به المرسلين فقال: {يايها الرسل كلوا من الطيبات واعملوا صالحا إني بما تعملون عليم} وقال: {يأيها الذين ءامنوا كلوا من طيبت ما رزقنكم}. ثم ذكر الرجل يطيل السفر أشعث أغبر، يمد يديه إلى السماء: يا رب يا رب، ومطعمه حرام، ومشربه حرام، وملبسه حرام، وغذي بالحرام فأنى يستجاب لذلك.
Muslim narrated it in the chapter on zakat (1015), from Abu Kurayb Muhammad bin Ala, who said, Abu Usama narrated to us, who said, Fudayl bin Marzuk narrated to us, who said, Adi bin Thabit narrated to me, from Abu Hazim, from Abu Hurairah, who said, then he mentioned it.