Distress from Satan

Then, after hardship, He sent down tranquillity upon you, a drowsiness that overtook some of you, while others were anxious, thinking wrongly about Allah, like the thoughts of ignorance. They asked, ‘Do we have any say in the matter?’ Say, ‘All matters belong to Allah.’ They conceal within themselves what they do not reveal to you, saying, ‘If we had any say, we would not have been killed here.’ Say, ‘Even if you had stayed in your homes, those destined to die would have gone to their places of death. Allah tests what is within you and purifies what is in your hearts.

3:154Then, after grief, He sent down security for you. As slumber did it overcome a party of you, while (the other) party, who were anxious on their own account, thought wrongly of Allah, the thought of ignorance. They said: Have we any part in the cause? Say (O Muhammad): The cause belongeth wholly to Allah. They hide within themselves (a thought) which they reveal not unto thee, saying: Had we had any part in the cause we should not have been slain here. Say: Even though ye had been in your houses, those appointed to be slain would have gone forth to the places where they were to lie. (All this hath been) in order that Allah might try what is in your breasts and prove what is in your hearts. Allah is Aware of what is hidden in the breasts (of men).

8:11When He made the slumber fall upon you as a reassurance from him and sent down water from the sky upon you, that thereby He might purify you, and remove from you the fear of Satan, and make strong your hearts and firm (your) feet thereby.