As Allah related in the Qur'an, in his early life, the Prophet Yusuf (as) was put through many tests, to which he responded with the utmost maturity and submission. No matter how dire the circumstances or how cunning the plots against him were, the Prophet Yusuf (as), never diverged from his faith, devotion, trust and submission to Allah, but rather drew nearer to Him and showed absolute submission.
For those who seek ways to draw nearer to Allah, there are really striking examples of moral perfection in the life of the Prophet Yusuf (as). The first thing we learn about him is the important dream he saw in his early years and the comment his father, Ya'qub (as), made about this dream:
Yusuf said to his father: "Father! I saw eleven bright stars, and the sun and moon as well. I saw them all prostrate themselves in front of me." "My son", he replied, "don't tell your brothers of your dream, lest they devise some scheme to injure you. Satan is the sworn enemy of man. Accordingly, your Lord will pick you out and teach you the true meaning of events and perfectly confer His blessing upon you as well as upon the family of Ya'qub, as He conferred it perfectly before upon your forebears, Ibrahim and Ishaq. Most certainly your Lord is All-Knowing, and Wise." (Surah Yusuf, 4-6)
Taking this dream to be a sign from Allah and realising that Yusuf (as) would become a noble person in Allah's sight in future, his father wanted him to keep this dream to himself. His brothers, who felt that their father held Yusuf (as) more dear, became jealous of their father's love and hatched a plot against Yusuf (as). They tried to kill him and draw their father's love to themselves:
In Yusuf and his brothers there are Signs for those who ask. They declared, "Why! Yusuf and his brother are dearer to our father than we are, although we constitute a powerful group. Our father is clearly making a mistake." Kill Yusuf or expel him to some far-off land, so that your father will look to you alone and after that you can be honourable men. One of them said, "Do not take Yusuf's life, but, if you must, throw him to the bottom of a well, so that some travellers may discover him." (Surah Yusuf, 7-10)
His brothers left Yusuf (as) in the depths of a well. Then, they came to their father, telling him that a wolf had devoured him, and offered his shirt with false blood stains as evidence. Despite this evidence, the Prophet Ya'qub (as) realized this incident to be a plot, took refuge in Allah and asked Him for help. Thanks to countless conditions predetermined by destiny, some travellers passing by the well found the Prophet Yusuf (as) and sold him as a slave to a governor in Egypt:
… Thus We established Yusuf in the land to teach him the true meaning of events. Allah is in control of all things, though most of mankind do not know it. And then when he became a full-grown man, We gave him knowledge and right judgment too. That is how We reward all doers of good. (Surah Yusuf, 21-22)
The wife of the governor who bought him approached the Prophet Yusuf (as), who was remarkably handsome, with wicked intentions. However, she was refused outright by Yusuf (as). Upon this, the wife of the governor resorted to slandering Yusuf (as) to maintain her innocence:
His master's wife attempted to seduce him. She barred the doors and said, "Come over here!" "Allah is my refuge!" he (Yusuf) replied. "He is My Lord and has treated me with kindness. Those who do wrong shall surely never prosper." (Surah Yusuf, 23)
They both rushed to the door. She tore his shirt at the back. They met her husband by the door. She said, "How should a man whose intention was to harm your family be punished for what he did, except with prison or painful punishment?" Yusuf said, "It was she who tried to seduce me."... (Surah Yusuf,25-26)
The governor saw the shirt torn at the back and said, "The source of this is women's deviousness. Without a doubt your guile is very great. Yusuf, ignore all this, and you, my wife, should ask forgiveness for your evil act. There is no doubt that you are in the wrong." (Surah Yusuf, 28-29)
She said, "You see! It's him you blamed me for. I tried seducing him but he refused. If he does not do what I order, he will be put in prison and brought low." "My Lord", said Yusuf, "prison is preferable to me than what they call on me to do. Unless You turn their guile away from me, it may well be that I will yield to them and so lapse into ignorance." His Lord answered his prayer and turned away from him their female guile and deviousness. He is the One Who Hears, the One Who Knows. Yet, even after they had seen the Signs, they thought that they should still imprison him for a time. (Surah Yusuf, 32-35)
… and so he stayed in prison for several years. (Surah Yusuf, 42)
Now after being plotted against by his brothers and unjustly slandered by the governor's wife, Yusuf (as) had nothing to look forward to but several years of imprisonment. However, throughout all these long years, the Prophet Yusuf (as) did not despair even for a moment but, aware that there is good and wisdom behind these events Allah ordained, hopefully prayed to Him and showed determination in his patience and faith. Indeed, years later, when the king sought for the interpretation of a dream he had had, an old prisoner recalled the Prophet Yusuf (as) as a person who had the faculty of interpreting dreams. Yusuf (as)'s interpretation of the dream greatly impressed the king. He thereupon called Yusuf (as) to his presence. Before the king had a chance to talk to him, the Prophet Yusuf (as) wanted the king to learn the facts about the incident for which he had been sent to prison so many years ago. So, for this explanation, the king returned to the governor's wife and the women to whom she had introduced Yusuf (as) at the time of the incident:
... (The women said:) "Allah forbid! We know no bad of him." The governor's wife then said, "The truth has now emerged. Indeed I tried to seduce him then and he has simply told the honest truth." (Surah Yusuf, 51)
After their confession, the Prophet Yusuf (as) gave the following explanation:
In this way he (i.e., the governor) will know at last that I did not dishonour him behind his back and that Allah most surely does not guide the deviousness of the dishonourable. I do not say that I myself was free from blame. The self indeed commands to evil acts—except for those my Lord has mercy on. My Lord, He is Forgiving and Merciful. (Surah Yusuf, 52-53)
These words of the Prophet Yusuf (as) are typical of his perfected faith. He always knew that Allah would help believers and those who are patient, and that He would certainly confound the schemes of those who betrayed Him. His trust in Allah manifested itself in his submission to his destiny. No matter how unfavourable the circumstances seemed, he could see that there was good and wisdom behind these events Allah ordained.
Another exemplary character trait of the Prophet Yusuf (as) was his refusal to indulge his lower self, even in situations in which he was absolutely right. He never trusted in his lower self and always remained conscious of the fact that one's lower self is prone to evil. This is a form of morality peculiar to those having perfected faith who act with the awareness that employing the methods of the devil, the lower self stealthily approaches human beings and tempts those who ignore the voice of their conscience.
The attitude of the Prophet Yusuf (as) towards his lower self is a manifestation of his moral maturity. No doubt, the ultimate fate of a person who shows such deep-seated submission to Allah and trusts in Him will be infinite good. Indeed, in return for this meritorious submission to Allah, he was placed in authority over the treasures of Egypt. Granting him a good life in this world and giving the good news of paradise in the hereafter, Allah stated that "He would not allow to go to waste the recompense of those who do good":
And thus We established Yusuf in the land and he dwelt there as he pleased. We grant Our grace to anyone We will and We do not allow to go to waste the recompense of those who do good. But the reward of the hereafter is the best for those who believe and fear their Lord. (Surah Yusuf, 56-57)