Sayyiduna Abu Hurayrah (may Allah be pleased with him) says that the Prophet (peace and blessings be upon him) said: "Do not wish to meet the enemy, but when you meet them and fight, be steadfast."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18461
Salim Abu al-Nadr, who was the freed slave of Umar bin Ubaydullah and his scribe, says: Abdullah bin Abi Awfa (may Allah be pleased with him) wrote a letter at the time of setting out towards the Haruriyyah, in which it was (stated) that on some of the days when the Messenger of Allah (peace and blessings be upon him) fought the enemy, he waited until the sun had declined, then addressed the people, saying: "O people, do not wish to meet the enemy, and ask Allah for well-being; and when you meet the enemy, be steadfast, and know that Paradise is beneath the shade of swords." Then he said: 'Allahumma munzil al-kitab, wa mujriya al-sahab, wa hazim al-ahzab, ihzimhum wansurna alayhim' (O Allah, Revealer of the Book, Mover of the clouds, Defeater of the confederates, defeat them and help us against them). The narrator says that Abu al-Nadr said: It has reached us that the Prophet (peace and blessings be upon him) made a similar supplication: 'Anta rabbuna wa rabbuhum, wa nahnu abiduka wa hum abiduka, wa nawasina wa nawasihim bi-yadika, fahzimhum wansurna alayhim' (You are our Lord and their Lord; we are Your servants and they are Your servants; our forelocks and their forelocks are in Your hand; so defeat them and help us against them).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18462
Sayyiduna Abu Musa (may Allah be pleased with him) says that whenever the Messenger of Allah (peace and blessings be upon him) feared a people, he (peace and blessings be upon him) would say: 'Allahumma inna naj'aluka fi nuhurihim wa na'udhu bika min shururihim' (O Allah, we place You before them and seek refuge in You from their evils).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18463
Sayyiduna Suhayb (may Allah be pleased with him) says: The Messenger of Allah (peace and blessings be upon him) would move his lips, but we could not understand it. We said: O Messenger of Allah (peace and blessings be upon him), you move your lips with something, but we cannot understand it. He (peace and blessings be upon him) said: "One of the prophets (peace and blessings be upon him) was pleased by the great number of his people, and he said: Who could stand against these? He said: It was said to him: Give your companions a choice: either We set an enemy over them who will destroy their community, or hunger, or death. He gave them the choice, and they chose death, and within three days seventy thousand men died." Then the Messenger of Allah (peace and blessings be upon him) said: "As for me, I say: 'Allahumma bika uqatilu, wa bika uhawilu, wa bika usawilu, wa la hawla wa la quwwata illa bika' (O Allah, with Your help I fight, by Your enabling I plan my affairs, and by Your enabling I contend; and the power to turn from evil and the strength to do good come only through Your enabling)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18464