Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:9:46

And if they had intended to go forth, they would have prepared for it ˹some˺ preparation. But Allah disliked their being sent, so He kept them back, and they were told, "Remain ˹behind˺ with those who remain."  

If they had desired to go forth, with you, they would have made some preparation for it, some equipment, such as tools and provisions, but God was averse that they should be sent forth, that is, He did not want them to go forth, so He slowed them down, He made them ˹feel˺ lethargic, and it was said, to them: ‘Stay back with those who stay back!’, ˹with˺ the sick, the women and the children: in other words, God decreed this.
القرآن:٩:٤٦

وَلَوْ أَرَادُوا الْخُرُوجَ لَأَعَدُّوا لَهُ عُدَّةً وَلَٰكِنْ كَرِهَ اللَّهُ انْبِعَاثَهُمْ فَثَبَّطَهُمْ وَقِيلَ اقْعُدُوا مَعَ الْقَاعِدِينَ  

{ولو أرادوا الخروج} معك {لأعدوا له عدة} أهبة من الآلة والزاد {ولكن كره الله انبعاثهم} أي لم يرد خروجهم {فثبطهم} كسَّلهم {وقيل} لهم {اقعدوا مع القاعدين} المرضى والنساء والصبيان، أي قدر الله تعالى ذلك.