Hasten at a funeral, for if (the dead person) is good, you would (soon) bring him close to the good. And if it is otherwise, it is an evil of which you are ridding yourselves. (Using translation from Muslim 944c)
سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ «أَسْرِعُوا بِالْجِنَازَةِ فَإِنْ كَانَتْ صَالِحَةً قَرَّبْتُمُوهَا إِلَى الْخَيْرٍ وَإِنْ كَانَتْ غَيْرَ ذَلِكَ كَانَ شَرًّا تَضَعُونَهُ عَنْ رِقَابِكُمْ»