Al-Ilmam bi-Ahadith al-Ahkam 240
وَعَن ثَوْبَان رَضِيَ اللَّهُ عَنْه، قَالَ: كَانَ رَسُول الله ﷺ إِذا انْصَرف من صلَاته اسْتغْفر ثَلَاثًا، وَقَالَ: " اللَّهُمَّ أَنْت السَّلَام ومنك السَّلَام، تَبَارَكت ذَا الْجلَال وَالْإِكْرَام "، قَالَ الْوَلِيد: فَقلت للأوزاعي: كَيفَ الاسْتِغْفَار؟ قَالَ: تَقول: أسْتَغْفر الله، أسْتَغْفر الله.
From Thawban, may Allah be pleased with him, who said: When the Messenger of Allah ﷺ finished his prayer, he would seek forgiveness three times and say: "O Allah, You are Peace and from You is peace. Blessed are You, O Possessor of majesty and honour." Al-Walid said: I said to al-Awzaʿi: "How is the seeking of forgiveness?" He said: "You say: Astaghfirullah, astaghfirullah [I seek Allah's forgiveness]."