A very beautiful woman who lived in Makkah Mukarramah was admiring herself in the mirror and asked her husband: “Is there any man who will see my face and not be tempted by it?” He replied: “Yes.” She asked: “Who?” He answered: “Ubaid Bin Umair.” She asked: “Will you allow me to tempt and entice him?” He agreed.
She approached Ubaid Bin Umair pretending to ask him an important question. When they were in a corner of Musjidul Haram, she unveiled her face and it shone like the full moon. Ubaid (Rahmatullahi Alayh) asked her: “O slave of Allah, what do wish to ask?” She replied: “Please fulfil my desires as I am in love with you.” Ubaid (Rahmatullahi Alayh) responded: “I would like to ask you a few questions. If you reply truthfully, I will consider your request.”
She remarked: “I will most certainly reply truthfully to as many questions as you wish to pose to me.”
Ubaid (Rahmatullahi Alayh) asked: “If the Angel of death comes to take your soul, would you be pleased that I fulfil your request at that time?” She replied: “By Allah, never.”
Ubaid (Rahmatullahi Alayh) then said: “You have spoken the truth. If you are lowered into your grave and about to be questioned by the Angels, would you be pleased that I fulfil your request at that time?” She replied: “By Allah, never.”
Ubaid (Rahmatullahi Alayh) then said: “You have spoken the truth. If you about to cross the bridge of Sirat and you do not know whether you will make it across, would you be please that I fulfil your request at that time?” she replied: “By Allah, never.”
Ubaid (Rahmatullahi Alayh) then said: “When the scales of deeds are set up and you do not know whether the scales of your good deeds are heavy or light, would you be pleased that I fulfil your request at that time?” She replied: “By Allah, never.”
Ubaid (Rahmatullahi Alayh) then said: “You have spoken the truth. When you are standing before Allah to account for your deeds, would you be pleased that I fulfil your needs at that time?” She replied: “By Allah, never.”
Ubaid (Rahmatullahi Alayh) then said to her: “You have spoken the truth. O slave of Allah, Fear Him, as He has bestowed you with many bounties.”
The woman then returned to her husband who asked: “What happened?” She replied: “We have been wasting away our lives until now.”
She then dedicated herself to salaah, fasting and other acts of worship. Thereafter her husband would often remark: “What has Ubaid done to me? Every night she was like a bride, but now she has no inclination to the world.”
Lesson: As humans we are often tempted towards acts of sin and immorality. Keeping the above mentioned points in mind before embarking on any sin will help greatly in suppressing the evil inclination
Source: https://islambestreligion.wordpress.com/2012/03/10/a-remedy-to-combat-sin-and-temptation/