Remembrance of Allah is one of the greatest acts that will save the person from Satan.
Ibn al-Qayyim records the hadith that was related by Abdurahman ibn Samra. He said that the RASOOL ALLAH صلی اللہ علیہ وسلم went out to them. He stood among them and said,
I saw something amazing yesterday. I saw a man from my community having the angel of death coming to him to take his soul. Then came good dealings with his parents (to intercede for him) and the angel of death left him. And I saw a man whose punishment in the grave was being laid out for him. Then came his ablutions and he was rescued by them. Then I saw a man from my community who had been surrounded by devils. Then came the remembrance of Allah and the devils were driven away from him. And I saw a man of my community who was surrounded by the angels of punishment, then there came his prayers and he was rescued from their hands. And I saw a man from my community who was panting from thirst. When he got close to them, he was prevented from every jug of water and they were taken away from him. Then came his fasting of the month of Ramadhan and, therefore, he drank and was satisfied. I saw a man from my community and I saw prophets sitting in groups. Every time the man went to the circles, he was driven away. Then came his washing from major defilement, and they took him by his hand and sat him beside me. And I saw a man from my community, in front of him was darkness, behind him was darkness, on his right was darkness, and on his left was darkness, and above him was darkness, and below him was darkness. And he was lost in the darkness. THEN came his pilgrimage and lesser pilgrimage and they took him out of the darkness and entered him into light. And I saw a man from my community who was being burned by a fire. Then there came his charity and it formed a cover between him and the fire. And it provided a shade over his head. And I saw a man from my community who was talking to the believers, but they would not talk to him. Then there came his keeping of family relations and it said, “Oh gathering of Muslims, he kept together family ties so speak with him. Therefore, the believers talked to him and they shook his hand. And I saw a man of my community who was encircled by the angels who throw the disbelievers into Hell. Then there came his ordering the good and forbidding the evil, so he was rescued from their hands. And he was entered among the angels of mercy. And I saw a man from my community who was kneeling and between him and Allah, there was a curtain. Then there came his good character and he was taken by his hand and permitted to be with Allah. And I saw a man from my community whose recorded deeds were taken from his left hand. Then there came his fear of Allah and he took his papers and had them placed on his right side. And I saw a man from my community who had very lite weight on the scale. Then there came his young children who had died and his weight was increased. I saw a man from my community who was on the brink of the Hell-fire. Then there came his hope in Allah and he was rescued from it and he moved on from it. I saw a man from my community who was thrown into the fire. Then there came his tears that he cried out of fear of Allah and he was rescued from that. And I saw a man from my community standing along a path that was shuddering in the same way that a limb of a palm tree shudders on a stormy night. Then there came his good thoughts about Allah and the shuddering was stopped. And I saw a man from my community crawling on the path [over the hell-fire]. Sometimes he was crawling on it and sometimes he was hanging from it. Then there came his prayers upon the Prophet and he was made to stand on his feet and he passed over it. And I saw a man from my community who came to the doors of paradise and they were closed in front of him. Then there came his testifying that there is no god except Allah and the doors were opened for him and he entered into paradise.
[Ibn al-Qayyim then stated,]
This hadith was recorded by Hafiz Abu Musa al-Madeeni in his book At-Targheeb fi al-Khisaal al manjia wa at-Tarheeb min al-Khilaal al Mardia In fact, this hadith is the basis of his book and the rest of the work is just a commentary on this hadith. He says that this hadith is very good. It was related by Amr ibn Bariz, ibn Zaid ibn Jadaan and Hilal Abu Jabalah from Saeed ibn al-Musayyab. Ibn Taimiya also thought highly of this hadith. It is reported to me that he used to say, “Supporting narrations show that it is authentic.”
The important portion of the hadith [for our purposes] is, I saw a man from my nation who had been surrounded by devils. Then came the remembrance of Allah and the devils were driven away from him.
This is consistent with the hadith of al-Harith which states, I order you to the remembrance of Allah. It is like a man who is being quickly chased by his enemies until he finds a safe fortress to be in and he has protected himself from them. In the same way, the remembrance of Allah protects one from Satan.