All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Dear brother, bad thoughts are the result of badly used leisure time. Some times one amuses himself in erotic things. This results in bad thoughts. He should turn towards Allah in repentance and perform acts of worship and good deeds as much as possible. He should ask Almighty Allah to protect him from all bad thoughts and acts. Homosexuality is a big crime inherited from the people of Prophet Lot. Because of the enormity of this sin, a severe punishment struck them. Some jurists believe that the punishment of homosexuality should be more severe than the one reserved for adultery. The man is inclined to the female and vice versa. This is how Allah created us. Anybody who tries to go against this goes against Allah’s will. Some scholars say that the evilness of this crime is lesser than the one of the Kufr. Perhaps it is greater than murder. Allah did not afflict any one by this big crime before the people of Lot.
Allah Says (what means):
• {And [We had sent] Lot when he said to his people, "Do you commit such immorality as no one has preceded you with from among the worlds?.} [Quran 7:80]
• {Do you approach males among the worlds.} [Quran 26:165]
A scholar said: “If Allah had not mentioned this crime in His Book (the Quran), I would not have imagined that a male may go unto a male.”
Allah inflicted punishments of many kinds on them: He showered stones on them, made them blind, and turned their houses upside down, etc. All these punishments were not but for the enormity of this crime. You should know that being murdered by a man is better than having homosexual intercourse with him. Because having sex with a man kills one’s humanity. Afterwards, there is no hope of a usual life. Unlike a murder, he would be a Martyr.
Khalid ibn al-Waleed wrote to Abu Baker that he found a man among some Arabs who was sexually used by some others as if he were a woman. Abu Baker gathered the Companions and took their advice; Ali said: “No nation has committed this great sin other than one, and all of you know, how Allah punished them. I think he should be burnt by fire. Then Abu Baker wrote to Khalid to burn him with fire. Khalid did what was written to him. Ibn Abbas said: “A highest place should be searched, then the Sodomite should be thrown down on his head and followed by stones (Rajm). Ibn Abbas deduced this opinion from the punishment of Allah inflicted on the people of Lot.
The Prophet said: “If you find any person doing the act of the people of Lot, then kill them both.” The Prophet cursed the sodomites three times. He did not curse any other wrong doers three times.
2 - No one came to Prophet asking him about homosexuality. On the contrary a person sought permission of adultery from the Prophet . The Prophet asked the man. Do you like it for your mother? He replied: “No”. The Prophet said: “Likewise, people do not like it for their mothers.” Then, he said: “Do you like it for your sister?” He said: “No” Then the Prophet said: “The people do not like it for their sisters either…” etc.
To chase away these bad thoughts, we recommend the following:
1 – The motive to seek a cure for this problem should be solely following Allah’s orders and fearing His punishment.
2 – A permanent and quick cure for this problem lies in marriage. One should get married as soon as possible.
3 – Keeping oneself busy in what is good for this world and the Hereafter life.
4 – Lowering the gaze from looking at forbidden things such as pictures, movies etc. May Allah protect all of us.
For more benefit, please refer to Fataawa 340615, 92314, 90562, 82048, and 81381.
Allah knows best.