Abul Azhar al-Aimari told that when God’s messenger went to his bed at night he said, “In the name of God. I have laid down my side for God. O God, forgive me my sin, drive away my devil, free me from my responsibility, and place me in the highest assembly.”
Abu Huraira told that when the Prophet went to his bed he used to say, “O God, Lord of the heavens, Lord of the earth, Lord of everything, who splittest the grain and the kernel, who hast sent down the Torah, the Injil and the Qur’an, I seek refuge in Thee from the evil of every evil agent whose forelock Thou seizest. Thou art the First and there is nothing before Thee; Thou art the Last and there is nothing after Thee; Thou art the Outward and there is nothing above Thee; Thou art the Inward and there is nothing below Thee. Pay the debt for me and grant me riches instead of poverty.”
Abu Dawud, Tirmidhi and Ibn Majah transmitted it. Muslim also transmitted it with a slight difference.
Ibn ‘Umar told that when God’s messenger went to his bed at night he said, “Praise be to God who has given me sufficiency, has guarded me, given me food and drink, been most gracious to me, and given to me most lavishly. Praise be to God in every circumstance. O God, Lord and King of everything, God of everything, I seek refuge in Thee from hell.”
‘Abdallah b. Ghannam reported God’s messenger as saying, that if anyone says in the morning, "O God, whatever favour has come to me or to any of Thy creatures in the morning, it comes from Thee alone who hast no partner, to whom be praise and thanksgiving," he will have expressed full thanksgiving for the day; and if anyone says the same in the evening he will have expressed full thanksgiving for the night.