Sunan an-Nasa'i, Book 21, Hadith 94 (In-Book) ⓘ
Abu Hurairah said: "I heard the Messenger of Allah say:,Hsten with the Janazah, for if it was righteous then you are taking it toward something good, and if it was otherwise, then it is an evil of which you are relieving yourselves."'
أَخْبَرَنَا سُوَيْدٌ، قَالَ حَدَّثَنَا عَبْدُ اللَّهِ، عَنْ يُونُسَ، عَنِ الزُّهْرِيِّ، قَالَ حَدَّثَنِي أَبُو أُمَامَةَ بْنُ سَهْلٍ، أَنَّ أَبَا هُرَيْرَةَ، قَالَ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ " أَسْرِعُوا بِالْجَنَازَةِ فَإِنْ كَانَتْ صَالِحَةً قَدَّمْتُمُوهَا إِلَى الْخَيْرِ وَإِنْ كَانَتْ غَيْرَ ذَلِكَ كَانَتْ شَرًّا تَضَعُونَهُ عَنْ رِقَابِكُمْ " .
also referenced under: Hadith 1911 (Reference) & Volume 3, Book 21, Hadith 1912 (DarusSalam)