There is a famous story about a companion of the Prophet ﷺ named Abu Hurairah. He was guarding the charity food of the Muslims when a thief crept in at night!
Abu Hurairah caught him — but the thief begged to be let go and promised to teach him something useful. He said: "When you go to your bed, recite Ayat al-Kursi. A protector from Allah will stay with you, and no shaytan will come near you until morning."
The next day the Prophet ﷺ said the thief had told the truth, even though he was a liar — and revealed that the "thief" had been a shaytan all along!