The Prophet ﷺ said, "It is not right for any Muslim who has something worth bequeathing to spend two nights without having his will written down with him."
حدثنا ابن أبي عمر حدثنا سفيان عن أيوب عن نافع
قال النبي ﷺ ما حق امرئ مسلم يبيت ليلتين وله ما يوصي فيه إلا ووصيته مكتوبة عنده
Agreed upon [by Bukhari and Muslim]. Muslim narrated it in the chapter on the will, the will of a man being written down and kept with him, hadith 3/1627, from the hadith of Ayub Sakhtiyani. Bukhari narrated it, hadith 2738, from the hadith of Nafi. Sufyan here refers to Ibn Uyayna.