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:16:81

And Allah has made for you, from that which He has created, shadows and has made for you from the mountains, shelters and has made for you garments which protect you from the heat and garments which protect you from your ˹enemy in˺ battle. Thus does He complete His favor upon you that you might submit ˹to Him˺.  

And it is God Who has made for you, from what He created, of houses, trees and clouds, shade (zilāl is the plural of zill) to protect you from the heat of the sun; and He has made for you, in the mountains, places of refuge (aknān is the plural of kinn, which is ˹a places˺ where one can seek shelter ˹istakanna˺, such as a cave or a tunnel); and He has made for you garments, shirts, that protect you from the heat, that is, and ˹also˺ from the cold, and garments that protect you from your ˹mutual˺ violence, ˹your˺ warring, in other words, ˹to protect you˺ from stabbed or struck during these ˹instances˺, ˹garments˺ such as coats of mail and armour plates. So, in the same way that He has created these things, He perfects His favour — in this world — to you, by creating that of which you have need, so that you, O people of Mecca, might submit, ˹that you might˺ affirm His Oneness.
القرآن:١٦:٨١

وَاللَّهُ جَعَلَ لَكُمْ مِمَّا خَلَقَ ظِلَالًا وَجَعَلَ لَكُمْ مِنَ الْجِبَالِ أَكْنَانًا وَجَعَلَ لَكُمْ سَرَابِيلَ تَقِيكُمُ الْحَرَّ وَسَرَابِيلَ تَقِيكُمْ بَأْسَكُمْ ۚ كَذَٰلِكَ يُتِمُّ نِعْمَتَهُ عَلَيْكُمْ لَعَلَّكُمْ تُسْلِمُونَ  

{والله جعل لكم مما خلق} من البيوت والشجر والغمام {ظلالاً} جمع ظل، تقيكم حر الشمس {وجعل لكم من الجبال أكنانا} جمع كن، وهو ما يستكن فيه كالغار والسرب {وجعل لكم سرابيل} قمصا {تقيكم الحر} أي والبرد {وسرابيل تقيكم بأسكم} حربكم أي الطعن والضرب فيها كالدروع والجواشن {كذلك} كما خلق هذه الأشياء {يُتم نعمته} في الدنيا {عليكم} بخلق ما تحتاجون إليه {لعلكم} يا أهل مكة {تسلمون} توحدونه.