Praise be to Allah.
Sexual desire is something that has been created in man and it cannot be got rid of. Getting rid of it is not something that is required of the Muslim; rather what is required of him is to refrain from using it in haraam ways, and to use it in the ways that Allaah has permitted.
The problem of desire in a young woman may be solved by taking two steps.
The first step is to reduce and weaken the things that may provoke desire in a person. This may be achieved in a number of ways, including the following:
1 – Lowering the gaze and refraining from looking at that which Allaah has forbidden. Allaah says (interpretation of the meaning):
“And tell the believing women to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts)”
The Prophet (peace and blessings of Allaah be upon him) said: “Do not follow one glance with another, for the first is allowed but not the second.” There are many sources of haraam looking, such as looking directly at young men and thinking about their attractive looks, or looking at pictures in magazines and movies.
2 – Avoiding reading stories and novels which focus on the sexual aspect, and avoiding reading internet websites which deal with such topics.
3 – Keeping away from bad company.
4 – Avoiding thinking about desire as much as possible. Thinking in and of itself is not haraam, but if one thinks about it for too long, that may lead a person to haraam actions.
5 – Spending one's time in useful pursuits, because spare time may lead one to fall into haraam things.
6 – Avoiding as much as possible going to public places where young men and women mix.
7 – If a girl is tested with studying in a mixed environment, and cannot find any alternative, she has to remain modest, serious and dignified, and should avoid sitting with young men and speaking to them as much as possible. She should restrict her relationships to friendships with righteous female classmates.
The second step is:
To strengthen the factors that will prevent one acting in accordance with one’s desires. This is achieved in a number of ways, including the following:
1 – Strengthening the faith in one’s heart and strengthening one’s relationship with Allaah. This may be achieved by remembering Allaah a great deal, reading Qur’aan, thinking of the names and attributes of Allaah, and doing a lot of naafil prayers. Belief strengthens the heart and soul, and it helps one to resist temptation.
2 – Fasting, as taught by the Prophet (peace and blessings of Allaah be upon him) when he said: “O young men, whoever among you can afford to, let him get married, for it is more effective in lowering the gaze and in guarding one’s chastity. Whoever cannot afford it, then let him fast, for it will be a shield for him.” This is addressed to young men, but it also includes young women.
3 – Strengthening one’s resolve and willpower, for this will make a young woman able to resist and control her desires.
4 – Remembering what Allaah has prepared for righteous young women. Allaah says (interpretation of the meaning):
“Verily, the Muslims (those who submit to Allaah in Islam) men and women, the believers men and women (who believe in Islamic Monotheism), the men and the women who are obedient (to Allaah), the men and women who are truthful (in their speech and deeds), the men and the women who are patient (in performing all the duties which Allaah has ordered and in abstaining from all that Allaah has forbidden), the men and the women who are humble (before their Lord Allaah), the men and the women who give Sadaqaat (i.e. Zakaah and alms), the men and the women who observe Sawm (fast) (the obligatory fasting during the month of Ramadaan, and the optional Nawafil fasting), the men and the women who guard their chastity (from illegal sexual acts) and the men and the women who remember Allaah much with their hearts and tongues. Allaah has prepared for them forgiveness and a great reward (i.e. Paradise)”
5 – Thinking about the lives of righteous women who guarded their chastity, such as Maryam, whom Allaah praises in the Qur’aan (interpretation of the meaning):
“And Maryam (Mary), the daughter of ‘Imraan who guarded
her chastity. And We breathed into (the sleeve of her shirt or her garment)
through Our Rooh [i.e. Jibreel (Gabriel)], and she testified to the truth of
the Words of her Lord [i.e. believed in the Words of Allaah: “Be!”
and he was; that is ‘Eesa (Jesus), son of Maryam (Mary) as a Messenger of
Allaah], and (also believed in) His Scriptures, and she was of the Qaanitoon
(i.e. obedient to Allaah)”
And thinking about the immoral, fallen women, and comparing between the two types, for there is a huge difference between them.
6 – Choosing righteous companions and spending time with them, so that they can help one another to obey and worship Allaah.
7 – Comparing the effects of immediate fulfillment of desire when a girl responds to haraam, which is followed by loss of pleasure and all that is left is regret and sorrow, with patience and striving against one’s whims and desires, and realizing that the pleasure of conquering one’s whim and desires is far greater than the pleasures of enjoying haraam things.
8 – Seeking help by calling upon Allaah and asking Him for help. The Qur’aan tells us the lesson to be learned from the story of Yoosuf (peace be upon him):
“He said: ‘O my Lord! Prison is dearer to me than that to which they invite me. Unless You turn away their plot from me, I will feel inclined towards them and be one (of those who commit sin and deserve blame or those who do deeds) of the ignorant’
So his Lord answered his invocation and turned away from him their plot. Verily, He is the All‑Hearer, the All‑Knower”
[Yoosuf 12:33 – interpretation of the meaning]