‘Ali رضي الله عنه narrates that Rasulullah ﷺ said,
“Whoever washes a deceased person, shrouds him, preserves him (from decaying), carries him and offers the funeral prayer for him, and does not disclose what he has seen, he will emerge from his sins as on the day his mother bore him.”
[Ibn Maajah]