The fifth article of Islamic faith is belief in divine decree which means that everything good or bad, all moments of happiness or sorrow, pleasure or pain, come from God.
Only those ˹destined to be˺ deluded are turned away from it. (Surah adh-Dhariyat, 51:9)
Second, God has recorded everything that will occur until the Day of Judgment in the Preserved Tablet (al-Lauh al-Mahfuz).
Allah eliminates and confirms what He wills, and with Him is the Master Record. (Surah ar-Ra'd, 13:39)
The life spans of all human beings are written and the amount of their sustenance apportioned.
"...Then there is sent to him the angel who blows his soul into him and who is commanded with four matters: to write down his rizq (sustenance), his life span, his actions, and whether he will be happy or unhappy (i.e. whether or not he will enter Paradise)." (40 Nawawi No. 4)
Fourth, God is the Creator of everything.
"He has created everything, and has ordained for it a measure." (Quran 25:2)
In Islamic doctrine every human act both in material and spiritual life is predestined, yet it is incorrect to believe the action of fate is blind, arbitrary, and relentless.
Without denying divine interference in human affairs, human liberty is kept intact. It does not discount the principle of man’s moral freedom and responsibility. All is known, but freedom is also granted.