The Prophet ﷺ used to perform spiritual retreat during the last ten days of Ramadan.Nafi said, "Abdullah showed me the place in the mosque where the Messenger of Allah ﷺ used to perform his retreat."
حدثنا سليمان بن داود المهري أخبرنا ابن وهب عن يونس أن نافعا أخبره
أن النبي ﷺ كان يعتكف العشر الأواخر من رمضان قال نافع وقد أراني عبد الله المكان الذي كان يعتكف فيه رسول الله ﷺ من المسجد
Reported by Bukhari, Itikaf, chapter: Itikaf during the last ten nights, no. 2025, and Muslim, Itikaf, chapter: Itikaf during the last ten nights of Ramadan, no. 2/1171, from the hadith of Abdullah bin Wahb, with this chain.