All people should know that Allah is All Wise and that there is great wisdom behind His commands and decrees. We Muslims believe that Allah is the Ultimate Cause of all causes in the universe. However, He has told us that He has appointed causes that work within His overriding will.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following: In Islam, we believe that Allah is the Ultimate Cause of all causes in the universe; nothing happens without His will. However, at the same time, He has told us that He has appointed causes that work within His overriding will. Therefore rain falls and diseases happen according to causes Allah has appointed. The devil is also created by Allah, and so it could be that in some cases afflictions happen because of one or another of such causes that have been appointed by Allah.
In face of such afflictions, however, we are ordered to seek a cure and to treat ourselves appropriately by using the means and resources available to us, while believing firmly that Allah alone is the Ultimate Healer and Curer, and thus never stop praying to Him. When we do turn to Allah consistently, we can rest assured that Satan can never exercise permanent control over us. This is a promise of Allah in the Qur’an.