وأمرَهم بطاعته ونهاهُم عن معصيتِه
He Has Commanded Them to Obey Him and He Has Forbidden Them to Disobey Him.
The statement of the author should be read in context of the previous three statements. Besides creating all things, fixing their terms, knowing all their deeds; Allāh created human beings with a purpose which gave their life meaning and significance. As Allāh says: ‘I have not created the jinns and mankind except that they should worship Me’ . And so He ordered mankind with acts of devotion and prohibited them from acts of disobedience.
One of the reasons for obligating humans in this manner is to test them to see how far they obey Allāh, devote themselves to Him, and adhere to His religion; this then establishes whether they go to Paradise or to the Hellfire. Life is essentially a major test and trial, and it is upon the human being to meet this challenge with devotion and worship; this is ultimately the purpose for which Allāh created man. As Allāh said: ‘He who created death and life to test which of you is best in action. He is the Almighty, the Ever-Forgiving.’  When Allāh commanded Ibrāhīm to sacrifice his son Ismā‘īl, the intention was not that the child be slaughtered; rather the aim was to test Ibrāhīm, and draw out from his heart devotion and pure subservience. As such, he became the friend (Khalīl) of Allāh.
The author’s statement: ‘He has commanded them to obey Him and He has forbidden them to disobey Him’ reconfirms to us the knowledge of Allāh; however, even though Allāh has the knowledge of all our deeds, His knowledge does not dictate or compel us to act in a certain way, as if we do not have a free will in the matter; otherwise what would be the point of commands and prohibitions in the first place? Allah Himself said: ‘If Allah had willed He would have made you one community. However, He misguides anyone He wills and guides anyone He wills. You will be questioned about what you did.’ 
Do Humans Have Free Will?
Everything in the Kingdom of Allāh exists & comes into existence by the decree (qadar) of Allāh. Nothing happens in His dominion except by His decree (qadar). There is nothing existing outside His decree (qadar). He creates all, and every single incident and occurrence is under His control; be that by way of direct control or through a freedom of limited choice, as: ‘you do not will except that Allāh wills.’. 
Whilst all that happens takes place within the framework of the Divine Decree (qadar), man has freedom of choice within those parameters. Allāh has decreed all things and part of His decree is that man is given freedom of limited choices. Man cannot live beyond his term, eat beyond his capacity, or select his trials in life. However, when a person eats, drinks, walks, buys and sells, gets married, and so on, he does such things by way of choice, exercising his God-given free will . The Qur’ān frequently attributes deeds to the people who undertook them, as when Allāh says: ‘so Mūsā stuck him with his fist and killed him…’, and the verse: ‘So he went forth before his people in his pomp…’, and His saying: ‘And there came a man running from the farthest part of the town’. In each verse Allāh mentions the deed with the doer who chose to do it.
The framework of Divine Will dictates that even though Allāh, Exalted is He, decreed ends and means; He did not decree effects without causes. That is to say that Allāh decreed that man can commit sin through sinful acts of disobedience, however He did not force them do the deed itself. On the contrary, He guided them through Messengers and revelation to refrain from misdeeds; it was then their choice whether to adhere to His commands or turn away. Whoever claims that Allāh decreed the ends and the effects without the means and causes has misunderstood Divine Decree (qadar wa qaḍā). He is like a person who claims that crops can grow without water or soil, or that one can nourish himself without food or water.
Greater elaboration on Divine Decree (qadar wa qaḍā) will follow in the coming points.
Point of Benefit:
If a person perceives no point in obeying the commands and prohibitions of Allāh, as one’s final destination is already ordained and unchangeable, this is an incorrect view as:
1) We must follow these commands as no one is aware of what their final destination will be and therefore one cannot rely on going to Paradise or resign oneself to going to Hellfire.
2) One’s final destination has been ordained on the basis of what one would do with one’s life, which Allāh was already aware or knew of.
 al-Dhāriyāt, 51: 56.  Q. Al-Mulk, 67: 2.  Q. Al-Naḥl, 16: 93.  Q. Al-Insān, 76: 30.  The term “free will” may not be entirely appropriate as its original meaning refers to the power of acting without the constraint of necessity or fate. This implies that the person will can out do the will of Allāh which is of course false. What is correct is to say that Allāh has decreed all things and from His decree is that man would be given freedom of limited choices.
The views expressed on Islam21c and its connected channels do not necessarily represent the views of the organisation.