Two men reviled one another in the Prophet’s presence when we were sitting near him, and when one of them who had become red in the face reviled the other angrily the Prophet said that he knew a phrase by repeating which the man could get rid of his angry feelings: “I seek refuge in God from that accursed devil.” Those present asked the man whether he heard what the Prophet was saying, and he replied, “I am not possessed by a devil.”*
*Majnun. The word literally means to be possessed by a jinni, but it can also mean to be possessed by a devil. Shaitan is used in the preceding sentence. Majnun is also used meaning ‘mad’, but that does not fit this context.
He told that God’s messenger used to say when he was anxious “There is no god but God, the Incomparably Great, the Clement; there is no god but God, the Lord of the mighty Throne; there is no god but God, the Lord of the heavens, the Lord of the earth, and the Lord of the noble Throne.”
Abu Huraira reported God's messenger as saying, “When you hear the cocks crowing ask God for some of His grace, for they have seen an angel; but when you hear an ass braying seek refuge in God from the devil, for it has seen a devil.”
Ibn ‘Abbas reported God’s messenger as saying that if anyone who means to have intercourse with his wife says, “In the name of God. O God, keep us away from the devil and keep the devil away from what Thou hast provided us,” should it be ordained that a child be born to them thereby, no devil will ever harm it.