I heard the Messenger of Allah ﷺ say, "Whoever among you fears that he will not be able to rise at night should perform the witr prayer before sleeping. But whoever is confident that he will rise should perform witr at the end of the night, for the recitation at the end of the night is witnessed, and that is better."
حدثنا حسن حدثنا ابن لهيعة حدثنا أبو الزبير
سمعت رسول الله ﷺ يقول من خاف منكم ألا يقوم بالليل فليوتر ثم ينام ومن طمع منكم بقيام فليوتر من آخر الليل فإن قراءة آخر الليل محضورة وذلك أفضل