It was narrated that ‘Aishah said: “I used to enter the house to relieve myself, and there was a sick person there, and I only inquired after him as I was passing through.” She said: “And the Messenger of Allah (ﷺ) would not enter the house except to relieve himself, then they were observing I’tikaf.”
It was narrated that Anas bin Malik said: “The Messenger of Allah (ﷺ) said: ‘The person observing I’tikaf may attend funerals and visit the sick.’”