Sahih Muslim #944 a
The Book of Prayer - Funerals 11:64
Abu Huraira 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.