“The Messenger of Allah (ﷺ) said: ‘The person observing I’tikaf may attend funerals and visit the sick.’”
Sunan Ibn Majah Book 7, Hadith 140