After the creation of heavens and the earth, the Almighty willed to appoint a representative on His earth. So He talked it over with the angels. The Angels said: “Do you wish to have a representative on the earth to cause corruption and commit murder there while we always extol you.”
And God replied, “I know something of which you are not aware.”
Then, the Almighty created Adam from the mud and blew a bit of Heavenly Soul in him. Then the angels were all ordered to prostrate before Adam.
They all did so but for the Satan. The Almighty asked him:
God:"What prevented you from prostrating before Adam? "
Satan replied: “I’m superior to him. You have made me from the fire and him from the mud. Thus I shall never obey him."
This way, Satan's jealousy deprived him from God's perpetual blessings and he was thereafter deserted and cursed by God. After being cursed and sent away from God's divine portal, Satan hopelessly begged God to give him time to be alive until the Resurrection Day and the Almighty accepted Satan's request and let him live till that specified day.
At this time Satan said:
“Now that you've driven me away from your divine portal, I shall be waiting for any opportunity to mislead Adam and for doing so I will attack him and his generation from all sides. Now it's time you come to notice that most of them won't be thankful to you.
The Almighty then warned Adam and his generation of the fact that Satan is their enemy and they shall be careful not to deviate from the right path and accordingly get miserable and sinful on the earth. At the same time, the Almighty promised Satan and his misled followers to place them deep down in Hell for good, for everyone shall know that the men of Satan are in perpetual loss. After that God taught Adam His Divine Attributes as well as some secrets and realities unknown to other creatures. He then turned to the angles and asked them to recite some of these attributes, if they knew any of them.
The angels said: “You’re glorified and exempted from all the evil, and we have no knowledge but
for what you've taught us. And truly you are the Knower and the Wise."
Adam required many things to continue his life and the Divine will had put some potentials and desires into him which were a part of his instinct and hidden somewhere inside him. On the other hand, the sole purpose of creation was not just bringing Adam “The father of Mankind " to the world but God has also wished to create other generations of mankind through the creation of Adam. To achieve this
goal, the Almighty then needed another creature of the same kind to be a proper couple for Adam so that they together produce human generation in the world. In this way Eve was created to serve as Adam’s spouse. According to God's will they were settled in paradise and fed themselves with abundant heavenly fruits. But they were ordered not to touch a certain tree for otherwise, they would have been considered to have disobeyed God's orders. But Satan who was waiting for an opportunity, tried to tempt and deceive Adam and Eve. Satan finally succeeded in tempting them and they not only approached the forbidden tree but also ate its fruit. Having done this they got quite remorseful of what they did and repented in God's divine portal. The Almighty accepted their repentance and from then on Adam, Eve and their generation were destined to live on the earth with all its difficulties and hardship and tried to survive.