Jami` at-Tirmidhi Book 48, Hadith 160
“I came to `Abdullah bin `Amr and said to him: ‘Report something to me that you heard from the Messenger of Allah (ﷺ).’ So he set forth before me a scroll and said: ‘This is what the Messenger of Allah (ﷺ) wrote for me.’” He said: “So I looked in it and found in it: ‘Indeed, Abu Bakr As-Siddiq, may Allah be pleased with him, said: “O Messenger of Allah, teach me what to say at morning and afternoon.” He said: “O Abu Bakr, say: ‘O Allah, Creator of the heavens and the earth, Knower of the unseen and the seen, there is none worthy of worship except You, Lord of everything and its Owner, I seek refuge in You from the evil of my soul and from the evil of Shaitan and his Shirk, or that I should do some evil to myself or bring it upon a Muslim (Allāhumma fāṭiras-samāwāti wal-arḍi, `ālimal-ghaibi wash-shahādati, lā ilāha illā anta, rabba kulli shai’in wa malīkahu, a`ūdhu bika min sharri nafsī wa min sharrish-shaiṭāni wa sharakihi, wa an aqtarifa `alā nafsī sū’an, aw ajurrahu ilā muslim).’”
“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.”
“I heard Abu Wa’il say: ‘`Abdullah bin Mas`ud said’ and I said to him: ‘Did you hear it from `Abdullah?’ He said: ‘Yes.’ And he narrated it in Marfu` form that he said: ‘There is none with more Ghirah than Allah, and due to this He prohibited the lewd sins, that which is apparent of them and that which is hidden. And there is none to whom praise is more beloved than Allah, and due to this, He praised Himself.’”