The Repentance - 9:40 "If you do not help him, Allah has helped him. (For example) the disbelievers drove him out as the second of the two. And when the two of them were in the cave, he used to say to his companion, "Do not grieve, Allah is with us"... Allah sent down on him peace and security and humbled the word of the disbelievers by supporting them with armies you did not see. Exalted is the word of Allah alone. Allah is the Exalted, the Wise."
What are the valid excuses for not participating in war?
The Victory/48:16 "Say to the remnant of the Arabs, "You will be called upon against a powerful people. You will fight them until they surrender. If you obey, Allah will give you a good reward. If you turn away, as you turned away before, He will punish you with a painful torment."
The Victory/48:17 There is no hardship for the blind, no hardship for the paralyzed, and no hardship for the sick. Whoever follows Allah and His messenger, He will admit him into Gardens from which rivers flow. And whoever turns away, He will punish him severely.

The Repentance/9:90 Those of the Arabs who fabricated excuses came to you for permission. So those who denied Allah and His messenger sat down. A painful torment will touch the disbelievers.
The Repentance/9:91 There is no condemnation for the weak, the sick and those who have nothing to give for help, provided they are sincerely devoted to Allah and His Messenger. Those who do good will not be condemned. Allah is Forgiving, Merciful.
The Repentance/9:92 "Likewise, those who come to you to give them a ride and you say, "I cannot find a vehicle to give you a ride,"and they turn back with tears in their eyes because of their financial inability."
The Repentance/9:93 Only those who asked you for permission while they were rich are reprehensible. They asked to be with those who stayed behind, and Allah stamped their hearts. Therefore they do not know.