Hadith regarding visiting sick people. The Messenger of Allah (S) 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 Rabb, how could I visit you and You are the Rabb 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?
Source: Visiting Sick! Allah Says, I Was Sick But You Did Not Visit Me (https://youtu.be/T6dqG51W6cM)
See Also: 10 Reasons why our dua is rejected