Hafsa said that when God’s messenger wanted to go to sleep he put his right hand under his cheek, and would then say three times, "O God, guard me from Thy punishment on the day when Thou raisest up Thy servants."
Hudhaifa said that when the Prophet wanted to go to sleep he placed his hand under his head and said, "O God, guard me from thy punishment on the day when Thou gatherest Thy servants," or "raisest up Thy servants."
Tirmidhi transmitted it, and Ahmad gave al-Bara’ as his authority.
‘Ali reported that God’s messenger used to say when he lay down, "O God, I seek refuge in Thy noble Person and in Thy perfect words from the evil of what Thou seizest by its forelock; O God, Thou removest debt and sin; O God, Thy troop is not routed, Thy promise is not broken, and the riches of the rich do not avail against Thee. Glory and praise be unto Thee."
Thauban reported God’s messenger as saying that if any Muslim says three times evening and morning, "I am pleased with God as Lord, with Islam as religion, and with Muhammad as Prophet," God will certainly please him on the day of resurrection.