Abu Hurairah (RA) reported Allah's Apostle (ﷺ) as saying: Make haste at a funeral; if the dead person was good, it is a good state to which you are sending him on; but if he was otherwise it is an evil of which you are ridding yourselves.
Hadith ReferenceSahih Muslim / The Book of Prayer - Funerals / Hadith: 944