The Prophet ﷺ used to observe itikaf during the last ten days of Ramadan until Allah took him, and his wives observed itikaf after him.
حدثنا قتيبة بن سعيد حدثنا الليث عن عقيل عن الزهري عن عروة
أن النبي ﷺ كان يعتكف العشر الأواخر من رمضان حتى قبضه الله ثم اعتكف أزواجه من بعده
Recorded by Muslim, itikaf, chapter on itikaf in the last ten nights of Ramadan, no. 1172, from Qutayba, and by Bukhari, itikaf, chapter on itikaf in the last ten nights, no. 2026, from the hadith of Layth bin Saad, through the same chain.