The Messenger of Allah ﷺ said, "Whoever stops at a place and then says, 'I seek refuge in the perfect words of Allah from the evil of what He has created,' nothing will harm him until he departs from that place."
حدثنا قتيبة حدثنا الليث عن يزيد بن أبي حبيب عن الحارث بن يعقوب عن يعقوب بن عبد الله بن الأشج عن بسر بن سعيد عن سعد بن أبي وقاص
عن رسول الله ﷺ قال من نزل منزلا ثم قال أعوذ بكلمات الله التامات من شر ما خلق لم يضره شيء حتى يرتحل من منزله ذلك
Muslim also narrated it in the Book of Remembrance and Supplication, chapter on seeking refuge from a bad decree, the misfortune of wretchedness, and the like, hadith no. 2708, from Qutayba, with the same wording. Malik also related it in Muwatta, 2/978, from someone he trusted, from Yaqub, with the same wording.The hadith of Ibn Ajlan was related by Ibn Majah, hadith no. 3547, and Nasai in Kubra, hadith no. 10395.