I have done something terrible, A few months ago, I came out of my over garments and cheated on my husband of 4 years, and became pregnant, how do I gain forgiveness of not only my husband, but Allah, what do I need to do?
Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Zina is an obnoxious sin that Allah firmly, forbids. He warned people against it. Allah says: "And come not near to the unlawful sexual intercourse. Verily, it is a Fâhishah [i.e. anything that transgresses its limits (a great sin)], and an evil way (that leads one to Hell unless Allah forgives him). (Al-Isra 17:32)
If such a sin is so awful for people in general, it is much more horrible when it is committed by a married woman. She not only breaches her husband's rights but also causes mixing of progeny and traces back to this husband a child who is not his.
So, hasten to repent from Zina. Adhere to Hijab which is obligatory upon you and make as much Istighfar as far as possible and multiply performing good deeds. Know also that the Blessing of Allah is unlimited and comprehensive. So do not despair. Allah says: "Say: "O 'Ibâdî (My slaves) who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allah, verily Allah forgives all sins. Truly, He is Oft-Forgiving, Most Merciful. (Az-Zumar 39:53)
We remind you also that you must conceal yourself. Do not inform anyone about what you did. Malik reported in Al-Muwatta that the Prophet (Sallallahu Alaihi wa Sallam) said: "Whoever happens to commit any of these filthy things, should conceal himself/herself with the screen of Allah." Multiply making Dua (supplication) for your husband and doing good to him but never tell him or inform him of what happened. As for the child, he is legally traced back to your husband as the Prophet (Sallallahu Alaihi wa Sallam) said: "The child is for the bed."[Al-Bukhari and Muslim]. This means the child is traced back to the husband who is the owner of the bed.