Ubayy ibn Ka‘b (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: "Do not curse the wind. If you see what you dislike thereof, then say: 'O Allah, we ask You for the good of this wind, the good of what it contains, and the good of what it is ordered to do. We seek refuge with You from the evil of this wind, the evil of what it contains, and the evil of what it is ordered to do.'"
عن أُبَيُّ بن كَعْبٍ -رضي الله عنه- مرفوعاً: «لا تَسُبُّوا الرِّيحَ، فإذا رأيتم ما تكرهون فقولوا: اللهم إنا نَسْأَلُكَ مِن خير هذه الريح، وخير ما فيها، وخير ما أُمِرَتْ به، ونعوذ بك من شر هذه الريح، وشر ما فيها، وشر ما أُمِرَتْ به» .
شرح الحديث :
The Prophet (may Allah's peace and blessings be upon him) prohibited cursing the wind, because it is a creature commanded by Allah, the Almighty. So, cursing it will be as cursing Allah and showing discontent with His Divine Decree. Then, the Prophet (may Allah's peace and blessings be upon him) guided us to return to its creator (Allah) by asking Him for its goodness and seeking refuge in Him from its evil. This is an act of worshiping Allah, the Almighty, and the attitude of monotheists in such a situation.