Abu Hurairah (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, "Verily, Allah, the Exalted, and Glorious will say on the Day of Resurrection: 'O son of Adam, I was ill but you did not visit Me.' He would say: 'O my Rubb, how could I visit you and You are the Rubb of the worlds?' Thereupon He would say: 'Did you not know that such and such a slave of Mine was ill but you did not visit him? Did you not realize that if you had visited him (you would have known that I was aware of your visit to him, for which I would reward you) you would have found Me with him? O son of Adam, I asked food from you but you did not feed Me.' He would submit: 'My Rubb, how could I feed You and You are the Rubb of the worlds?' He would say: 'Did you not know that such and such a slave of Mine asked you for food but you did not feed him? Did you not realize that if you had fed him, you would certainly have found (its reward) with Me? O son of Adam, I asked water from you but you did not give it to Me.' He would say: 'My Rubb, how could I give You (water) and You are the Rubb of the worlds?' Thereupon He would say: 'Such and such a slave of Mine asked you for water to drink but you did not give it to him. Did you not realize that if you had given him to drink you would have found (its reward) with Me?"'[Muslim].
App reference: Book 7, Hadith 3
Arabic/English book reference: Book 7, Hadith 896