عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ رَضِيَ اللَّهُ عَنْهُ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ مَنْ قَالَ حِينَ يَأْوِي إِلَى فِرَاشِهِ أَسْتَغْفِرُ اللَّهَ الَّذِي لَا إِلَهَ إِلَّا هُوَ الْحَيُّ الْقَيُّومُ وَأَتُوبُ إِلَيْهِ ثَلَاثَ مَرَّاتٍ غَفَرَ اللَّهُ لَهُ ذُنُوبَهُ وَإِنْ كَانَتْ مِثْلَ زَبَدِ الْبَحْرِ وَإِنْ كَانَتْ مِثْلَ رَمْلِ عَالِجٍ وَإِنْ كَانَتْ مِثْلَ عَدَدِ وَرَقِ الشَّجَرِ
It is narrated from Sayyiduna Abu Khudri (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: Whoever, upon coming to his bed, recites this supplication three times: "Astaghfirullaha alladhi la ilaha illa huwa al-hayyul-qayyum wa atubu ilayh" (I seek forgiveness from Allah, there is no deity except Him, the Ever-Living, the Sustainer, and I turn to Him in repentance), then Allah Almighty forgives his sins, even if they are as much as the foam of the sea, or as much as the sand of the place of 'Aalij (in the evening), or even as much as the leaves of the trees.