Truly Allah created mankind on this earth, giving people wisdom with which to think, and to differentiate right from wrong, and to know useful things from harmful ones, and having the ability to do good or evil. Thus man is able to worship Allah, pray, fast, help the poor, reconcile among people in case of a conflict, behave well towards his parents, relatives and neighbours and do other good deeds.
All these actions can be distinguished as good and righteous as opposed to bad, through man's use of his mind.
On the one hand, man is able to do good deeds, and on the other hand he is able to do evil and wicked ones. He is able to steal, lie, cheat, kill, hurt people, disbelieve in Allah, and obey the oppressor, while his wisdom is able to differentiate that these actions are wicked and evil.
Man can do good or evil deeds through his own will and choice and he himself decides between the two. Allah gave him this ability so it is up to man how he behaves.
Allah, the Almighty, bids man to do good and pious deeds and forbids him to commit wicked and evil actions.
Thus, He sent the prophets to mankind to make clear to people what is bad and harmful and what is forbidden. He also clarified for them what is useful and lawful and obligatory for people to follow. Verily, the Almighty, will charge us on the Day of Resurrection regarding our deeds which we do in our life. Those who do evil and disobey Him are cast into hell and those who do good and obey Him enter the Garden of Paradise.
Surely Allah in His wisdom and justice does not make the doer of good and evil equal.
According to their deeds, each will be either rewarded or punished on Judgement Day.
Among Allah's justice is that He does not place any burden upon a person, which is beyond their ability to bear. For instance, no sick or old person will be blamed for not fasting because it would harm their health. Obligations, however, are quite modest, like prayer being only five short duties a day, which virtually no one should find difficult to perform.
O Allah, bless Muhammad and his Progeny.