The Prophet ﷺ said, "The expiation for sins committed in gatherings is for a servant to say, 'Glory be to You, Allah, and praise be to You. I seek Your forgiveness and turn to You in repentance.'"
حدثنا هيثم حدثنا إسماعيل بن عياش عن سهيل بن أبي صالح عن أبيه
عن النبي ﷺ قال كفارة المجالس أن يقول العبد سبحانك اللهم وبحمدك أستغفرك وأتوب إليك
Its isnad is sahih, and it has occurred many times before. See Bukhari 9/39. Hakim also graded it sahih in Mustadrak 4/282 with similar wording, and Dhahabi agreed with him.