All praise is due to Allah, and may peace and blessings be upon the Messenger of Allah. To proceed:
Human actions are of two types: matters in which people have no choice, and matters in which they have their own will and ability to choose.
Examples of matters beyond a person's control include the time of birth, the color of one's skin, hair, and eyes, and the time of death. A person has no control over choosing these matters, and therefore, they do not incur reward or punishment.
As for voluntary actions, these include choosing faith or disbelief, obedience or disobedience, what to eat and drink, where to live, and other aspects of daily life. A person chooses these actions through his own will and ability, and therefore, he is held accountable for them.
Nevertheless, none of the actions of human beings falls outside the knowledge, will, and decree of Allah, Exalted be He. Allah knew the actions of His servants before they came into existence, recorded them, willed that they would occur, and created His servants, their abilities, and their actions. Allah says:
“Indeed, We have created everything according to a precise measure.” [Al-Qamar 54:49]
And He, Glorified be He, says:
“Indeed, We guided him to the way, whether he is grateful or ungrateful.” [Al-Insan 76:3]
This does not mean that Allah compels His servants to perform their actions. Rather, they possess a genuine will and a genuine ability to choose. However, their will does not exist independently of the will and decree of Allah, Exalted be He. As He says:
“And you do not will unless Allah wills.” [Al-Insan 76:30]
Accordingly, the correct position is to say: We act through our own will and choice. We are not compelled to perform our voluntary actions, but our will, ability, and actions all fall within the knowledge, will, and decree of Allah.
Something may occur in the universe that Allah does not love or approve of, such as disbelief and sins, yet it occurs by His universal will for wisdom that He knows, Glorified be He. This does not mean that He loves disbelief or sinful acts. Something may be disliked in itself, yet Allah decrees it because of the greater benefits and wisdom that may result from it. This is similar to a sick person who dislikes bitter medicine even though it is a means of recovery.
A servant is therefore responsible for his choices and deeds. It is not permissible to use divine predestination as an excuse for committing sins or neglecting obligations, because the decree is part of the unseen, which a person does not know before performing an action. Rather, he must take the necessary means, choose obedience, avoid disobedience, and then accept what Allah has decreed after it occurs.
And Allah knows best.