The Quran describes two kinds of reactions. In verses 12 to 20, hypocrites and those with disease in their hearts said that Allah and His Messenger had promised only delusion. Some asked permission to leave, saying their houses were exposed, and the Quran says they wanted only to flee. Verse 11 says the believers were tested and shaken severely.
In contrast, verse 22 says that when the believers saw the confederates, they said, in meaning, that this is what Allah and His Messenger promised, and that Allah and His Messenger spoke the truth, and it only increased their faith and submission. Verse 23 praises men who were true to their pledge to Allah.
In verse 21, Allah tells us that in the Messenger of Allah there is an excellent example for those who hope in Allah and the Last Day and remember Allah often. The hadith show this example in practice: the Prophet ﷺ worked beside his companions, shared their hunger and prayed for them. In Sahih al-Bukhari 4115, he also made dua against the confederates, asking Allah to defeat them and shake them.