Validity of acts of worship by someone committing a sin that entails executing the Hadd
Someone drinks Khamr (intoxicants) and commits Zina (sexual intercourse outside marriage) but they perform Salah (Prayer) and the other fundamental deeds of Islam; is the ‘Ibadah (worship) they perform considered valid?
Whoever drinks Khamr, commits Zina, or indulges in any sin while considering it Halal (lawful); is regarded as a Kafir (disbeliever) whose good deeds are rendered invalid. On the other hand, if that person commits sins because the weakness of their souls overcomes them but they acknowledge that such a sin is Haram (unlawful) and they hope that Allah may help them to avoid it; they will be considered believers for their sound beliefs though they are Fasiqs (those who flagrantly violate Islamic law) for the major sins they commit.
However, if a person commits a sin; it will be Wajib (obligatory) for them to make Tawbah (repentance to Allah), acknowledge their sin, determine not to commit it again, and feel remorse for what they have committed. A sinner has to seek protection in the shield and respite that Allah grants them. It is worth mentioning that Allah (Glorified and Exalted be He) deprived Iblis of His Mercy, expelled him forever, and made him cursed devil because of one sin i.e. the refusal to make Sujud (Prostration) to Adam when Allah (Exalted be He) commanded him to do so. Allah also expelled Adam from Jannah (Paradise) when the latter committed one act of disobedience to Allah (Glorified and Exalted be He).
However, Adam made Tawbah and thus Allah accepted him and guided him to the straight path. Besides, slaves of Allah should not follow tricky and malicious attitudes towards Allah. Rather, they have to fear Allah, do whatever He commands them to do, and abandon whatever He commands them to abandon.
May Allah grant us success. May peace and blessings be upon our Prophet, his family and Companions