The Messenger of Allah ﷺ said, "It is not right for any Muslim man who has something concerning which he should make a will to spend two nights without having his will written down with him."
أخبرنا محمد بن سلمة قال حدثنا ابن القاسم عن مالك عن نافع
أن رسول الله ﷺ قال ما حق امرئ مسلم له شيء يوصى فيه يبيت ليلتين إلا ووصيته مكتوبة عنده
Bukhari narrated it in Wasaya, chapter on Wasaya, no. 2738, from the hadith of Malik with the same chain, and it is also in Muwatta (Yahya): 2/761, and in Kubra, no. 6443.