A Good Example from the Qur'an: The Character of Mary
Allah gives the example of Mary, mother of the Prophet Jesus (pbuh), as a servant devoted only to Him. Before she was born, Mary was dedicated to Allah by her mother with prayers that she would be a good servant and free from all worldly attachments:
Remember when the wife of 'Imran said, "My Lord, I have pledged to You what is in my womb, devoting it to Your service. Please accept my prayer. You are the All-Hearing, the All-Knowing." (Surah Al 'Imran, 35)
Other verses in the Qur'an, show that Allah accepted her mother's prayer about Mary. We are told that she was morally pure and virtuous:
Her Lord accepted her with approval and made her grow in health and beauty… (Surah Al 'Imran, 37)
Allah chose her and gave her great honor:
And when the angels said, "Mary, Allah has chosen you and purified you. He has chosen you over all other women." (Surah Al 'Imran, 42)
Moreover, we are told that Allah commanded her to be sincerely submissive and obedient to Him.
[The Angels said,] "Mary, obey your Lord and prostrate and bow with those who bow." (Surah Al 'Imran, 43)
At a certain point in her life, Mary left her family and moved east.
Mention Mary in the Book, how she withdrew from her people to an eastern place. (Surah Maryam, 16)
There she lived alone and received the marvelous message of the birth of the Prophet Jesus (pbuh). This good news was brought to her by Gabriel.
When the Angels said, "Mary, your Lord gives you good news of a Word from Him. His name is the Messiah, Jesus, son of Mary, of high esteem in this world and the hereafter, and one of those brought near." (Surah Al 'Imran, 45)
By a miracle from Allah, Mary became pregnant untouched by any man and gave birth to the Prophet Jesus (pbuh) in a remote place (Surah Maryam, 20). Mary humbly accepted the fate that Allah had prepared for her and, after the birth, trusted in Allah and took refuge in Him against all the accusations of the people. The people did not understand all the miraculous events that preceded and followed the birth of the Prophet Jesus (pbuh), and Allah tells us about the hurtful calumny directed against her.
She brought him to her people, carrying him. They said, "Mary! You have done an unthinkable thing! Sister of Aaron, your father was not an evil man, nor was your mother an unchaste woman!" (Surah Maryam, 27-28)
In another verse Allah tells us that the people rejected Allah and brought many false accusations against Mary:
And [We punished them] on account of their disbelief, and their utterance of a monstrous slander against Mary. (Surat an-Nisa', 156)
When Allah wanted Mary to take the Prophet Jesus (pbuh) and return to her people; without any concern for what they might think about her or the accusations they would make, she obeyed His command. Even though she found herself in a situation difficult to explain, she did exactly what was expected of her. She reacted to the accusations against her as becomes a Muslim. By obeying Allah's command and being unconcerned about what people thought of her, she showed her moral character to be quite different from those ignorant people who disregarded Allah and made deities out of their fellow men (Allah is beyond that).
With these examples in the Qur'an from the life of Mary, Allah shows us Divine wisdom. Mary was tested in this world with wondrous events. In a very difficult environment that demanded a lot of patience, she endured the onslaught of others' accusations. As a result of all this, Allah made the Prophet Jesus (pbuh) speak while he was still in the cradle and clear his mother of all the accusations against her.
Just like Mary, everyone sincerely attached to Allah is under His protection. Whatever people may say or think about him, a person who practices the morality of the Qur'an is not concerned, because just as in the case of Mary, the important thing is where he stands in the Sight of Allah.