The Prophet (ﷺ) said, "Hurry up with the dead body for if it was righteous, you are forwarding it to welfare; and if it was otherwise, then you are putting off an evil thing down your necks."
Sahih al-Bukhari Book 23, Hadith 72