Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- Almighty Allah is Just, and He bestowed on people the conscience to help them choose the right from the wrong, and He clarified the right and wrong through His Prophets and Messengers.
2- Being given the freedom to choose, one will be held accountable for his or her choice on the Day of Judgment.
In his response to your question, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
Allah tells us in the Qur’an that while nothing happens in the world without His will, including whatever we do, He wills that we should exercise our choice; He also tells us that He will either reward us or punish us according to our acts based on our own will.
In other words, since we have been given the freedom and ability to choose, we are accountable for the way we exercise the same. Almighty Allah says:
“And by the soul and Him that formed it, inspiring it with the thought of what is good for it and the thought of what is bad for it: Successful indeed is the one who purifies it, and wretched is the one who debases it.” (Ash-Shams 91:7-11)
“Say: “Truth is from your Lord.” Now whosoever will, may believe, and whosoever will, may disbelieve.” (Al-Kahf 18:29)
In conclusion, while it is true that everything happens in conformity with the supreme will of Allah, we are accountable for our actions, since we have the freedom to choose and act.
This is in accordance with Allah’s justice as He endowed us with conscience, whereby we know what is right and what is wrong.
Besides, He also endowed us with our rational faculties and sent down revelations, whereby He has communicated His will for us. Hence, we are accountable for our actions.
Allah Almighty knows best.
Excerpted, with slight modifications, from www.islam.ca