Ibn 'Umar (Allah be pleased with both of them) reported that the Messenger of Allah ﷺ used to observe i'tikaf in the last ten days of Ramadan. (Using translation from Muslim 1171a)
أَنَّ رَسُولَ اللهِ ﷺ كَانَ يَعْتَكِفُ الْعَشْرَ الْأَوَاخِرَ مِنْ رَمَضَانَ