Abu Hurairah reported,

The Messenger of Allah ﷺ said, "A man who had never done any good deed said to his family, 'When I die, burn my body and 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 not inflicted on anyone in all the worlds.'So Allah commanded the sea, and it gathered what was in it, and He commanded the land, and it gathered what was in it. Then He asked him, 'Why did you do this?'The man replied, 'Out of fear of You, and You know best.'So Allah forgave him."

Bukhari 7506

Sahih

حدثنا إسماعيل حدثني مالك عن أبي الزناد عن الأعرج

عن أبي هريرة

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

البخاري 7506صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tawhid
Chapter
His saying, "They want to change the words of Allah"
Numbering
Darussalam 7506
Bukhari 7506