The Messenger of Allah ﷺ said, "It is not right for a Muslim who has something to bequeath to spend three nights without having his will written and kept with him."
أخبرنا أحمد بن يحيى بن الوزير بن سليمان قال سمعت ابن وهب قال أخبرني يونس وعمرو بن الحارث عن ابن شهاب
عن رسول الله ﷺ قال ما حق امرئ مسلم له شيء يوصى فيه فيبيت ثلاث ليال إلا ووصيته عنده مكتوبة
Reported by Muslim, hadith no. 4/1627, from the hadith of Ibn Wahb through the same chain (see the previous hadith), and it is in Kubra, hadith no. 6446.