Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tirmidhi:3528ʿAlī b. Ḥujr > Ismāʿīl b. ʿAyyāsh > Muḥammad b. Isḥāq > ʿAmr b. Shuʿayb from his father from his grandfather

“When one of you becomes frightened during sleep, then let him say: ‘I seek refuge in Allah’s Perfect Words from His anger, His punishment, and the evil of His creatures, from the whisperings of the Shayatin, and that they should come (Aʿūdhu bikalimātillāhit-tāmmati min ghaḍabihī wa ʿiqābihī wa sharri ʿibādih, wa min hamazātish-shayāṭīni wa an yaḥḍurūn).’ For verily, they shall not harm him.” He said: “So ʿAbdullah bin ʿAmr used to teach it to those of his children who attained maturity, and those of them who did not, he would write it on a sheet and then hang it around his neck.”  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Gharīb.
الترمذي:٣٥٢٨حَدَّثَنَا عَلِيُّ بْنُ حُجْرٍ حَدَّثَنَا إِسْمَاعِيلُ بْنُ عَيَّاشٍ عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ عَنْ عَمْرِو بْنِ شُعَيْبٍ عَنْ أَبِيهِ عَنْ جَدِّهِ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا فَزِعَ أَحَدُكُمْ فِي النَّوْمِ فَلْيَقُلْ أَعُوذُ بِكَلِمَاتِ اللَّهِ التَّامَّةِ مِنْ غَضَبِهِ وَعِقَابِهِ وَشَرِّ عِبَادِهِ وَمِنْ هَمَزَاتِ الشَّيَاطِينِ وَأَنْ يَحْضُرُونِ فَإِنَّهَا لَنْ تَضُرَّهُ قَالَ وَكَانَ عَبْدُ اللَّهِ بْنُ عَمْرٍو يُلَقِّنُهَا مَنْ بَلَغَ مِنْ وَلَدِهِ وَمَنْ لَمْ يَبْلُغْ مِنْهُمْ كَتَبَهَا فِي صَكٍّ ثُمَّ عَلَّقَهَا فِي عُنُقِهِ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ

See similar narrations below:

Collected by Abū Dāwūd, Aḥmad, Ḥākim, Suyūṭī
abudawud:3893Mūsá b. Ismāʿīl > Ḥammād > Muḥammad b. Isḥāq > ʿAmr b. Shuʿayb from his father from his grandfather

The Messenger of Allah ﷺ sued to teach them the following words in the case of alarm: I seek refuge in Allah's perfect words from His anger, the evil of His servants, the evil suggestions of the devils and their presence. Abdullah ibn Amr used to teach them to those of his children who had reached puberty, and he wrote them down (on some material) and hung on the child who had not reached puberty.  

أبو داود:٣٨٩٣حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ حَدَّثَنَا حَمَّادٌ عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ عَنْ عَمْرِو بْنِ شُعَيْبٍ عَنْ أَبِيهِ عَنْ جَدِّهِ

أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ يُعَلِّمُهُمْ مِنَ الْفَزَعِ كَلِمَاتٍ أَعُوذُ بِكَلِمَاتِ اللَّهِ التَّامَّةِ مِنْ غَضَبِهِ وَشَرِّ عِبَادِهِ وَمِنْ هَمَزَاتِ الشَّيَاطِينِ وَأَنْ يَحْضُرُونِ وَكَانَ عَبْدُ اللَّهِ بْنُ عَمْرٍو يُعَلِّمُهُنَّ مَنْ عَقَلَ مِنْ بَنِيهِ وَمَنْ لَمْ يَعْقِلْ كَتَبَهُ فَأَعْلَقَهُ عَلَيْهِ  

ahmad:6696Yazīd > Muḥammad b. Isḥāq > ʿAmr b. Shuʿayb from his father from his grandfather

[Machine] The Prophet ﷺ used to teach us words to say before sleeping out of fear. "In the name of Allah, I seek refuge in the perfect words of Allah from His anger, punishment, evil slaves, and from the whispers of devils and their presence." Abdullah bin Amr used to teach it to those of his sons who had reached the age of understanding, and he would write it for those who were still young and put it on their necks.  

أحمد:٦٦٩٦حَدَّثَنَا يَزِيدُ أَخْبَرَنَا مُحَمَّدُ بْنُ إِسْحَاقَ عَنْ عَمْرِو بْنِ شُعَيْبٍ عَنْ أَبِيهِ عَنْ جَدِّهِ قَالَ

كَانَ رَسُولُ اللهِ ﷺ يُعَلِّمُنَا كَلِمَاتٍ نَقُولُهُنَّ عِنْدَ النَّوْمِ مِنَ الْفَزَعِ بِسْمِ اللهِ أَعُوذُ بِكَلِمَاتِ اللهِ التَّامَّة مِنْغَضَبِهِ وَعِقَابِهِ وَشَرِّ عِبَادِهِ وَمِنْ هَمَزَاتِ الشَّيَاطِينِ وَأَنْ يَحْضُرُونِ قَالَ فَكَانَ عَبْدُ اللهِ بْنُ عَمْرٍو يُعَلِّمُهَا مَنْ بَلَغَ مِنْ وَلَدِهِ أَنْ يَقُولَهَا عِنْدَ نَوْمِهِ وَمَنْ كَانَ مِنْهُمْ صَغِيرًا لَا يَعْقِلُ أَنْ يَحْفَظَهَا كَتَبَهَا لَهُ فَعَلَّقَهَا فِي عُنُقِهِ  

hakim:2010Abū Bakr Muḥammad b. Aḥmad b. Bālawayh > ʿAbdullāh b. Aḥmad b. Ḥanbal > ʿUbaydullāh b. ʿUmar > Jarīr b. ʿAbd al-Ḥamīd > Muḥammad b. Isḥāq > ʿAmr b. Shuʿayb from his father from his grandfather > ʿAbdullāh / Ibn ʿAmr

[Machine] I heard the Messenger of Allah ﷺ commanding with these words of alarm, "I seek refuge in the perfect words of Allah from His anger, His punishment, the evil deeds of His servants, and the whispers of devils, and that they come near." Abdullah bin Umar and those who reached from his children taught them to him, so he recited them in front of his people. And whoever did not reach from them, he wrote them and hung them around his neck.  

الحاكم:٢٠١٠حَدَّثَنِي أَبُو بَكْرٍ مُحَمَّدُ بْنُ أَحْمَدَ بْنِ بَالَوَيْهِ ثنا عَبْدُ اللَّهِ بْنُ أَحْمَدَ بْنِ حَنْبَلٍ ثنا عُبَيْدُ اللَّهِ بْنُ عُمَرَ ثنا جَرِيرُ بْنُ عَبْدِ الْحَمِيدِ عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ عَنْ عَمْرِو بْنِ شُعَيْبٍ عَنْ أَبِيهِ عَنْ جَدِّهِ عَنْ عَبْدِ اللَّهِ وَهُوَ ابْنُ عَمْرٍو قَالَ

سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَأْمُرُ بِكَلِمَاتٍ مِنَ الْفَزَعِ «أَعُوذُ بِكَلِمَاتِ اللَّهِ التَّامَّاتِ مِنْ غَضَبِهِ وَمِنْ عِقَابِهِ وَمِنْ شَرِّ عِبَادِهِ وَمِنْ هَمَزَاتِ الشَّيَاطِينِ وَأَنْ يَحْضُرُونَ» قَالَ كَانَ عَبْدُ اللَّهِ بْنُ عُمَرَ وَمَنْ بَلَغَ مِنْ وَلَدٍ عَلَّمَهُنَّ إِيَّاهُ فَقَالَهُنَّ عِنْدَ قَوْمِهِ وَمَنْ لَمْ يَبْلُغْ مِنْهُمْ كَتَبَهَا فَعَلَّقَهَا فِي عُنُقِهِ  

«هَذَا حَدِيثٌ صَحِيحُ الْإِسْنَادِ مُتَّصِلٌ فِي مَوْضِعِ الْخِلَافِ»
suyuti:2242a
Request/Fix translation

  

السيوطي:٢٢٤٢a

"إِذَا فزعَ أحدُكُم في النَّوم فليقلْ: باسْم الله أعوذُ بكلماتِ الله التَّامة مِنْ غضبِه وشرِّ عقابه وشرِّ عبِاده، ومِنْ همزاتِ الشَّياطين وأنْ يحضرون؛ فإِنها لنْ تَضُرَّه".  

[ش] ابن أبى شيبة [ت] الترمذي حسن غريب عن عمرو بن شعيب عن أبيه عن جده