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:2

So travel freely, ˹O disbelievers˺, throughout the land ˹during˺ four months but know that you cannot cause failure to Allah and that Allah will disgrace the disbelievers.  

‘Journey freely, travel in security, O idolaters, in the land for four months — beginning with ˹the month of˺ Shawwāl, on the basis of what will come shortly — after which there will be no security for you, and know that you cannot escape God, that is, you shall ˹not˺ elude His punishment, and that God degrades the disbelievers’, humiliating them in this world by having them killed, and in the Hereafter, by ˹sending them to˺ the Fire.
القرآن:٩:٢

فَسِيحُوا فِي الْأَرْضِ أَرْبَعَةَ أَشْهُرٍ وَاعْلَمُوا أَنَّكُمْ غَيْرُ مُعْجِزِي اللَّهِ ۙ وَأَنَّ اللَّهَ مُخْزِي الْكَافِرِينَ  

{فسيحوا} سيروا آمنين أيها المشركون {في الأرض أربعة أشهر} أولها شوال بدليل ما سيأتي ولا أمان لكم بعدها {واعلموا أنكم غيرُ معجزي الله} أي فائتي عذابه {وأنَّ الله مخزي الكافرين} مذلُّهم في الدنيا بالقتل والأخرى بالنار.