What did our beloved Prophet Muhammad PBUH do all day during his I'tikaf?
The Prophet (pbuh) used to perform Itikaf in Ramadan, especially the last ten days of Ramadan.
(the wife of the Prophet) The Prophet used to practice Itikaf in the last ten days of Ramadan till he died and then his wives used to practice Itikaf after him. (https://muflihun.com/bukhari/33/243)
However, the Prophet (pbuh) performed Itikaf for 20 days on the year of his death.
Narrated Abu Huraira:
The Prophet used to perform Itikaf every year in the month of Ramadan for ten days, and when it was the year of his death, he stayed in Itikaf for twenty days. (https://muflihun.com/bukhari/33/260)
Moreover, the Prophet (pbuh) performed Itikaf in the last ten days of Shawwal when he was not able to perform it in Ramadan.
Narrated 'Amra bint 'Abdur-Rahman from 'Aisha:
Allah's Apostle used to practice Itikaf every year in the month of Ramadan. And after offering the morning prayer, he used to enter the place of his Itikaf. 'Aisha asked his permission to let her practice Itikaf and he allowed her, and so she pitched a tent in the mosque. When Hafsa heard of that, she also pitched a tent (for herself), and when Zainab heard of that, she too pitched another tent. When, in the morning, Allah's Apostle had finished the morning prayer, he saw four tents and asked, "What is this?" He was informed about it. He then said, "What made them do this? Is it righteousness? Remove the tents, for I do not want to see them." So, the tents were removed. The Prophet did not perform Itikaf that year in the month of Ramadan, but did it in the last ten days of Shawwal. (https://muflihun.com/bukhari/33/257)
As for the question--What did the Prophet (pbuh) do in Itikaf?---, it is written below:
Literally, itikaf means waiting somewhere and stopping. Whether good or bad, it means binding the soul to something. Religiously, it refers to a Muslim abandoning outside relations and cares and staying in a mosque for some time with the purpose of worship. In the 187th verse of Chapter al-Baqarah of the Qur'an, it is stated: “...do not associate in intimacy with them (your wives) during the period when you are in retreat in the mosques...”; so itikaf is a type of worship which is present both in the Qur'an and in the Sunnah (the practice of the Prophet). (https://questionsonislam.com/article/itikaf-prophet)
When Allah's Messenger, peace and blessings upon him, wanted to perform itikaf, his bed or his bedstead on which he slept would be placed in front of or behind the Pillar of Repentance (Abu Lubaba), which was in the mosque. (Ibn-i Majah, Siyam: 61) Narrated 'Aisha: (the wife of the Prophet) Allah's Apostle used to let his head in (the house) while he was in the mosque and I would comb and oil his hair. When in Itikaf he used not to enter the house except for a need. (https://muflihun.com/bukhari/33/246)
So Itikaf is mainly worshipping Allah alone and to remember him and to do righteousness. In short, a Muslim is supposed to pray salat (e.g. Nafl salat), recite Quran, make Du'a, etc in the Mosque.
One may perform a “Nafil” type of “itikaf” in a Masjid for one or two days, or even for an hour according to Imam Shafi, Imam Yusuf, and Imam Muhammad. (https://al-talib.org/what-is-itikaf/)
I hope you got the answer.