Abu Hurairah reported,

The Messenger of Allah ﷺ said, "A man who had never done a single good deed said to his family, 'When I die, burn my body, then scatter half of my ashes on land and half in the sea, for by Allah, if Allah gains power over me, He will punish me with a punishment He has never inflicted on anyone in all the worlds.'When the man died, his family did as he had instructed. Allah then commanded the land to gather what it contained, and He commanded the sea to gather what it contained.Then Allah asked him, 'Why did you do this?'He answered, 'Out of fear of You, my Lord, and You know best.'So Allah forgave him."

Azami 159

Sahih

عن أبي هريرة

أن رسول الله ﷺ قال: قال رجل لم يعمل حسنة قط لأهله: إذا مات فحرقوه ثم اذروا نصفه في البر، ونصفه في البحر، فوالله لئن قدر الله عليه ليعذبنه عذابا لا يعذبه أحدا من العالمين، فلما مات الرجل فعلوا ما أمرهم به فأمر الله البر فجمع ما فيه، وأمر البحر فجمع ما فيه، ثم قال: لم فعلت هذا؟ قال: من خشيتك يا رب وأنت أعلم. قال: فغفر له.

الأعظمي 159صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Allah's mercy is greater than His punishment
Numbering
Jami al-Kamil 159 (2nd edition)
Azami 159