[Machine] Narrated Aisha, the wife of Prophet Muhammad, may ﷺ , said that the Prophet used to observe I'tikaf (seclusion for worship) during the last ten days of Ramadan until Allah (God) took him. After him, his wives also observed I'tikaf. The Sunnah (tradition) of I'tikaf is that one should not leave except for necessities and should not return while being sick or have any physical contact with women. And I'tikaf should only be observed in a congregational mosque. The Sunnah for those who observe I'tikaf is to fast.
عَنْ عَائِشَةَ زَوْجِ النَّبِيِّ ﷺ أَنَّ النَّبِيَّ ﷺ كَانَ يَعْتَكِفُ الْعَشْرَ الْأَوَاخِرَ مِنْ رَمَضَانَ حَتَّى تَوَفَّاهُ اللهُ ﷻ ثُمَّ اعْتَكَفَ أَزْوَاجُهُ مِنْ بَعْدِهِ وَالسُّنَّةُ فِي الْمُعْتَكِفِ أَنْ لَا يَخْرُجَ إِلَّا لِلْحَاجَةِ الَّتِي لَا بُدَّ مِنْهَا وَلَا يَعُودُ مَرِيضًا وَلَا يَمَسُّ امْرَأَةً وَلَا يُبَاشِرُهَا وَلَا اعْتِكَافَ إِلَّا فِي مَسْجِدِ جَمَاعَةٍ وَالسُّنَّةُ فِيمَنِ اعْتَكَفَ أَنْ يَصُومَ