Allah's Messenger (ﷺ) used to practice I`tikaf in the last ten days of the month of Ramadan.
Sahih al-Bukhari Book 33, Hadith 1