WHEN TO PRAY WITR..
If a person asks, should I perform Witr before I sleep or in the last part of the night? We say: The Messenger ﷺ clarified the ruling,
“Whosoever fears he will not awaken in the last part of the night then perform Witr in the first part, and whosoever hopes to wake up in the last part then perform Witr in the last part, since the prayer of the last part of the night is witnessed and that is better.”*
* Muslim (755).
Book: The Prophet’s Prayer Described
By Shaykh al-Allāmah Muhammad b. Sālih al-Uthaymīn
Translated by Abū Mu’ādh Taqweem Aslam