The Prophet (ﷺ) used to perform I`tikaf every year in the month of Ramadan for ten days…

Sahih al-Bukhari Book 33 Hadith 19

Sahih al-Bukhari #2044

Retiring to a Mosque for Remembrance of Allah (I'tikaf) 33:19

Narrated Abu Huraira:

The Prophet (ﷺ) used to perform I`tikaf every year in the month of Ramadan for ten days, and when it was the year of his death, he stayed in I`tikaf for twenty days.

Chapter: I'tikaf in the middle ten days of Ramadan

Grade: Sahih