Sayyiduna Khalid bin al-Walid (may Allah be pleased with him) said: I could not sleep at night, so the Prophet (peace and blessings be upon him) said to me: "Shall I not teach you some words which, when you say them, you will fall asleep? Say: 'Allahumma rabbas-samawati wa ma azallat, wa rabbal-aradina wa ma aqallat, wa rabbash-shayatini wa ma adallat, kun li jaran min sharri jami'il-jinni wal-ins, wa an yafruta 'alayya ahadun minhum aw an yu'dhiyani, 'azza jaruka wa jalla thana'uka wa la ilaha ghayruk' (O Allah, Lord of the heavens and all that they shade, Lord of the earths and all that they carry, and Lord of the devils and all whom they have led astray, be a protector for me from the evil of all jinn and mankind, lest any of them transgress against me or harm me. Mighty is the one You protect, majestic is Your praise, and there is no god besides You)."
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3824