It has been narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) said
Do not desire an encounter with the enemy; but when you encounter them, be firm.
It is narrated by Abu Nadr that he learnt from a letter sent by a man from the Aslam tribe, who was a Companion of the Prophet (ﷺ) and whose name was 'Abdullah b. Abu Aufa, to 'Umar b. 'Ubaidullah when the latter marched upon Haruriyya (Khawarij) informing him that the Messenger of Allah (ﷺ) in one of those days when lie was confronting the enemy waited until the sun had declined. Then he stood up (to address the people) and said
O ye men, do not wish for an encounter with the enemy. Pray to Allah to grant you security; (but) when you (have to) encounter them exercise patience, and you should know that Paradise is under the shadows of the swords. Then the Messenger of Allah (ﷺ) stood up (again) and said: O Allah. Revealer of the Book, Disperser of the clouds, Defeater of the hordes, put our enemy to rout and help us against them.