وَإِن يَمْسَسْكَ ٱللَّهُ بِضُرٍّ فَلَا كَاشِفَ لَهُۥٓ إِلَّا هُوَ ۖ وَإِن يَمْسَسْكَ بِخَيْرٍ فَهُوَ عَلَىٰ كُلِّ شَىْءٍ قَدِيرٌ
10:108.
Commentary:
It is his own actions that are the cause of all harm that befalls a man. The words, if Allah touch thee with affliction, therefore, do not mean that God is the cause of affliction. They are meant to convey the idea that God being the first cause of all things, everything that happens in the universe is in a way attributable to Him. The expression is also intended to hint that it is God alone Who can remove man’s afflictions.
Happiness indeed comes from God, Who is the real source of all good. This is why, when speaking of happiness coming to man, the Quran uses the expression, He has power to do all that He wills.
10:108.