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.’”