Jabir bin Abdullah reported,

I heard the Prophet ﷺ say, "Whoever among you fears that he will not rise at the end of the night should perform witr and then sleep. And whoever is confident he will rise at night should perform witr at the end of it, for the recitation at the end of the night is witnessed, and that is better."

Muslim 1767

Sahih

و حدثني سلمة بن شبيب حدثنا الحسن بن أعين حدثنا معقل وهو ابن عبيد الله عن أبي الزبير

عن جابر قال

سمعت النبي ﷺ يقول أيكم خاف أن لا يقوم من آخر الليل فليوتر ثم ليرقد ومن وثق بقيام من الليل فليوتر من آخره فإن قراءة آخر الليل محضورة وذلك أفضل

مسلم 1767صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Travelers' prayer and its shortening
Chapter
Whoever fears he will not wake at the end of the night should pray witr at its beginning
Numbering
Darussalam 1767
Muslim 1767