I did not hear this hadith from Allah's Apostle ﷺ directly but it was Zaid b. Thabit who narrated it from him. As Allah's Apostle ﷺ was going along with us towards the dwellings of Bani an-Najjar, riding upon his pony, it shied and he was about to fall. He found four, five or six graves there. He said: Who amongst you knows about those lying in the graves? A person said: It is I. Thereupon he (the Holy Prophet) said: In what state did they die? He said: They died as polytheists. He said: These people are passing through the ordeal in the graves. If it were not the reason that you would stop burying (your dead) in the graves on listening to the torment in the grave which I am listening to, I would have certainly made you hear that. Then turning his face towards us, he said: Seek refuge with Allah from the torment of Hell. They said: We seek refuge with Allah from the torment of Hell. He said: Seek refuge with Allah from the torment of the grave. They said: We seek refuge with Allah from the torment of the grave. He said: Seek refuge with Allah from turmoil, its visible and invisible (aspects), and they said: We seek refuge with Allah from turmoil and its visible and invisible aspects and he said: Seek refuge with Allah from the turmoil of the Dajjal, and they said We seek refuge with Allah from the turmoil of the Dajjal.
أَبُو سَعِيدٍ وَلَمْ أَشْهَدْهُ مِنَ النَّبِيِّ ﷺ وَلَكِنْ حَدَّثَنِيهِ زَيْدُ بْنُ ثَابِتٍ قَالَ بَيْنَمَا النَّبِيُّ ﷺ فِي حَائِطٍ لِبَنِي النَّجَّارِ عَلَى بَغْلَةٍ لَهُ وَنَحْنُ مَعَهُ إِذْ حَادَتْ بِهِ فَكَادَتْ تُلْقِيهِ وَإِذَا أَقْبُرٌ سِتَّةٌ أَوْ خَمْسَةٌ أَوْ أَرْبَعَةٌ قَالَ كَذَا كَانَ يَقُولُ الْجُرَيْرِيُّ فَقَالَ مَنْ يَعْرِفُ أَصْحَابَ هَذِهِ الأَقْبُرِ فَقَالَ رَجُلٌ أَنَا قَالَ فَمَتَى مَاتَ هَؤُلاَءِ قَالَ مَاتُوا فِي الإِشْرَاكِ فَقَالَ إِنَّ هَذِهِ الأُمَّةَ تُبْتَلَى فِي قُبُورِهَا فَلَوْلاَ أَنْ لاَ تَدَافَنُوا لَدَعَوْتُ اللَّهَ أَنْ يُسْمِعَكُمْ مِنْ عَذَابِ الْقَبْرِ الَّذِي أَسْمَعُ مِنْهُ ثُمَّ أَقْبَلَ عَلَيْنَا بِوَجْهِهِ فَقَالَ تَعَوَّذُوا بِاللَّهِ مِنْ عَذَابِ النَّارِ قَالُوا نَعُوذُ بِاللَّهِ مِنْ عَذَابِ النَّارِ فَقَالَ تَعَوَّذُوا بِاللَّهِ مِنْ عَذَابِ الْقَبْرِ قَالُوا نَعُوذُ بِاللَّهِ مِنْ عَذَابِ الْقَبْرِ قَالَ تَعَوَّذُوا بِاللَّهِ مِنَ الْفِتَنِ مَا ظَهَرَ مِنْهَا وَمَا بَطَنَ قَالُوا نَعُوذُ بِاللَّهِ مِنَ الْفِتَنِ مَا ظَهَرَ مِنْهَا وَمَا بَطَنَ قَالَ تَعَوَّذُوا بِاللَّهِ مِنْ فِتْنَةِ الدَّجَّالِ قَالُوا نَعُوذُ بِاللَّهِ مِنْ فِتْنَةِ الدَّجَّالِ