Sahih Muslim Book 35, Hadith Number 6550.
Chapter : Supplication at the time of sleeping and going to bed.
Abdullah b. ‘Umar commanded a person that as he went to bed, he should say: “O Allah, Thou created my being and it is for Thee to take it to its ultimate goal. And its death and life is due to Thee, and if Thou givest it life, safeguard it; and if Thou bringst death, grant it pardon. O Allah, I beg of Thee safety.” A person said to him: Did you hear it from Umar? Thereupon he said: (I have heard from one) who is better than Umar, viz, from Allah’s Messenger (may peace be upon him). Ibn Nafi, reported this on the authority of Abdullah b. Harith but he did not make mention of this “that he heard it himself”.