'Abdullah bin Abu Aufa (May Allah be pleased with them) reported:
On one occasion the Messenger of Allah (ﷺ) was confronting the enemy. He waited until the sun had declined. Then he stood up to address the people and said, "O people! Do not wish for an encounter with the enemy. Pray to Allah to grant you safety; (but) when you encounter them, show patience, and know that Jannah is under the shades of the swords." Then he (ﷺ) said: "Allahumma munzilal-kitab, wa mujriyas- sahab, wa hazimal-Ahzab, ihzimhum wansurna alaihim (O Allah, Revealer of the Book, Disperser of the clouds, Defeater of the Confederates, put our enemy to rout and support us against them)."[Al- Bukhari and Muslim].
App reference: Book 12, Hadith 40
Arabic/English book reference: Book 12, Hadith 1324