How the Prophet slept

The Messenger of God would put his blessed right hand under his blessed right cheek. He would lie on his blessed right side facing the Qibla.
Supplication Before Sleeping
Hudhayfa (may God be pleased with him) states that, before the Prophet went to sleep, he would place his right hand under his cheek and pray this supplication: ‘Alla-humma Bis-mika Amu-tu WaAhya’ ‘O Allah (The Exalted) with Your name I die and I live’. Before going to sleep we should think of the sins we may have done and try our best not to do these again, repent and ask for God’s guidance. If you want to spend your night in worship then sleep the way our beloved Prophet slept and offer the morning prayer in congregation. You will surely gain the reward of worshipping all night, even though you were sleeping.
Manners of Sleeping
1. One should recite ‘Bismillah’ whilst closing the doors and latching the lock.
2. Containers with foodstuff including water should be covered with the recitation of ‘Bismillah’.
3. Extinguish any burning fire i.e. candles, fireplace etc.
4. Switch off or put out anything that may catch alight, if left on.
5. Discuss with members of the household matters relating to Islam. For example, by telling stories (of companions of the Prophet, etc.) or simply talking about matters that pleases the family but within the confines of the Sharia.
6. Have available Surma and apply three times to the right and the left eye.
7. Sleep in a state of purity.
8. Lay or spread the bed yourself
9. Clean the bed three times with a cloth before sleeping.
10. When a boy reaches the age of ten, he must not sleep in the same room as his sister, mother or another woman except his wife.
11. For two men to sleep on one bed or under one blanket is not permissible; it has been prohibited in the hadith.
12. A child of ten and older must not sleep in the same bed as husband and wife.
13. The feet should not be facing towards Mecca or Medina.
14. Before sleeping, recite ‘Bismillah’ and the three Quls, and thereafter blow on the palms and rub one’s entire body three times, beginning from the head and ending at the toes.
15. Using a pillow (to rest one’s head on is Sunna.
16. The Messenger disliked lying on his stomach.
17. Do not have your feet facing the Koran or other religious books. However, if the books are higher than the feet, there is no problem.
18. Recite any Sura from the Koran one remembers, especially Sura Mulk, Sura Sajdah , Sura Bani Israeel and Sura Zumar.
19. Recite Sura Waaqi’ah before sleeping, as this safeguards one from hunger and poverty.
20. Keeping a prayer mat for the Tahajjud prayer besides the head is Sunna.
21. When going to sleep, remember your grave, as you will be sleeping on your own with your deeds and no one will be there with you.
22. Remember God the Almighty because the state a person sleeps in is the state in which one will wake up.
23. Do not sleep after ‘Asr (afternoon) as there is a chance of losing the intellect and it is undesirable to sleep in the beginning part of the morning and between Maghrib and Isha (the time between evening and night).
Source: Islam.ru/en/