The Prophet ﷺ used to observe I'tikaf during the last ten days of Ramadan. Nafi' said: 'Abd Allah (b. 'Umar) showed me the place in the mosque where Messenger of Allah ﷺ used to observe I'tikaf.
أَنَّ النَّبِيَّ ﷺ كَانَ يَعْتَكِفُ الْعَشْرَ الأَوَاخِرَ مِنْ رَمَضَانَ قَالَ نَافِعٌ وَقَدْ أَرَانِي عَبْدُ اللَّهِ الْمَكَانَ الَّذِي يَعْتَكِفُ فِيهِ رَسُولُ اللَّهِ ﷺ مِنَ الْمَسْجِدِ