I suspect I have the HIV virus and I think that this was the reason that I started to pray. But now feel that there is hope for me yet. Sometimes when I pray bad thoughts come into my mind, I think of sex or of being out with the guys smoking Ganja, but I've stopped all that except Ganja. But still I have trouble forgetting about sex when I pray but not other times it only happens allot when I pray.
Praise be to Allah, the Lord of the World; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Prayer is the second pillar of Islam; it ranks high among Islamic obligations. Whoever abandons it may face a dangerous end. Sound Hadith state that one who abandons it is a disbeliever. So, one should not neglect performing prayers under any circumstance, since between a person and disbelief is discarding the prayer.
One has to perform it while one is healthy or sick, or during "ups and downs". Allah, The Great and Almighty, dispraises and threatens those who come to Him while they are in distress and turn away while they are at ease.
He Says: {And when harm touches men, they cry sincerely only to their Lord (Allâh), turning to Him in repentance, but when He gives them a taste of His Mercy, behold! a party of them associate partners in worship with their Lord. So as to be ungrateful for the graces which We have bestowed on them. Then enjoy (your short life); but you will come to know.} [30:33-34]. Also He Says: {And when harm touches man, he invokes Us, lying down on his side, or sitting or standing. But when We have removed his harm from him, he passes on his way as if he had never invoked Us for a harm that touched him! Thus it seems fair to the Musrifûn that which they used to do.} [10:12].
Therefore, a Muslim has to keep to perform his/her prayers and all other forms of worship in all situation and under all circumstances.
Dear questioner! You have to repent at once and seek Allah's pardon and pleasure, since neglecting the prayer.
In addition, you are also to give up taking (Ganja) or any similar kind of drugs, because such a practice is very dangerous Here and Hereafter. It is a major sin. You have to be careful and to get benefit from others' bad circumstances/state of affairs such as their getting a dangerous illness due to illegal sex relations or their taking drugs.
This situation makes it clear that Allah prohibits only what is harmful.
As for insinuation and bad ideas that attack you while praying, it is from Satan. So, you are to seek Allah's help and to seek refuge with Him, and then, do your best to avoid letting oneself go with such ideas.
The Satan, for sure, is desirous to spoil a Muslim human being and to prevent him from getting anything beneficial.
We ask Allah to help all of us to be on the upright way and to follow the sound opinion.
Allah knows best.
You can search for fatwa through many choices