He commits prohibited acts in private and wants advice
Question

I hope that you can save me from the punishment and wrath of Allah. I am a Muslim who had an Islamic upbringing and was raised with good morals and manners, and I am still viewed like that by others, but unfortunately I often give in to temptation and go to indecent websites and look at immoral images and videos on my phone, where people cannot see me. I know that Allah sees me, but every time I commit this immoral deed I do not only watch, but I also commit the secret habit. I am married and have children. I know that what I am doing is an animalistic action, when only Allah, may He be exalted can see me. I know that this action erases good deeds and even obliterates them. I pray and repent, and I remain patient for a day or two, then I go back to it again. I feel a strong and strange urge to open the phone and look at pictures and videos, and to commit that evil deed. I do not know what I should do. I know that if I die, I will go to hell, but I cannot control myself. Help me and save me, may Allah have mercy on you.
Praise be to Allah.We understand what you are suffering of anguish because of what you are committing of sin and doing that repeatedly. This anguish is a good sign, as it indicates that even though you are sick in one way, in another way you are still healthy and there is still some good in you. The ultimate remedy for this problem can only be closing all the doors that lead you to disobey Allah; close every door that leads you to despair of the mercy of Allah. Allah, may He be exalted, says (interpretation of the meaning):
{Say, “O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful”} [az-Zumar 39:53]
{ And those who do not invoke with Allah another deity or kill the soul which Allah has forbidden [to be killed], except by right, and do not commit unlawful sexual intercourse. And whoever should do that will meet a penalty.
Multiplied for him is the punishment on the Day of Resurrection, and he will abide therein humiliated,
Except for those who repent, believe and do righteous work. For them Allah will replace their evil deeds with good. And ever is Allah Forgiving and Merciful.
And he who repents and does righteousness does indeed turn to Allah with [accepted] repentance} [al-Furqan 25:68-71].
Ibn al-Qayyim (may Allah have mercy on him) said in al-Jawab al-Kafi (p. 165):
The wisdom of Allah, may He be exalted, which is based on justice and grace has dictated that the one who repents from sin is like one who never sinned.
Allah, may He be glorified, has guaranteed the one who repents from shirk, murder and zina that He will turn his bad deeds into good deeds. This is a general ruling which applies to everyone who repents from sin.
And Allah, may He be exalted, says (interpretation of the meaning):
{Say, “O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins. Indeed, it is He who is the Forgiving, the Merciful”} [az-Zumar 39:53].
No sin is excluded from the general meaning of the verse, but it is particularly true in the case of those who repent. End quote.
Allah, may He be exalted, has described the muttaqin (the pious, those who are mindful of Allah and fearHim) in His Book as being those who, if they commit major sins, or wrong themselves by committing minor sins, they remember the Almighty, the Oft-Forgiving, so they seek forgiveness for their sins and do not continue to do them or persist in sin.
Allah, may He be glorified and exalted, says (interpretation of the meaning):
{And hasten to forgiveness from your Lord and a garden as wide as the heavens and earth, prepared for the righteous,
Who spend [in the cause of Allah] during ease and hardship and who restrain anger and who pardon the people - and Allah loves the doers of good,
And those who, when they commit an immorality or wrong themselves [by transgression], remember Allah and seek forgiveness for their sins - and who can forgive sins except Allah? - and [who] do not persist in what they have done while they know.
Those - their reward is forgiveness from their Lord and gardens beneath which rivers flow [in Paradise], wherein they will abide eternally; and excellent is the reward of the [righteous] workers} [Al ‘Imran 3:133-136].
The one who persists in sin is the one who commits it, then commits sin again, time after time, without repenting or seeking forgiveness.
As for the one who commits a sin, then repents soundly and sincerely from it, then weakens and goes back to sin again, then repents sincerely from it, and so on, is alternating between sin and disobedience, on the one hand, and repentance, regret and turning to the Most Merciful, the Most Gracious, on the other hand. There is the possibility that he will be pardoned by Allah, if Allah wills, and there is the hope that Allah will help him to overcome his problem and forgive him his sins.
It was narrated that Abu Hurayrah said: I heard the Messenger of Allah (blessings and peace of Allah be upon him) say: “A man committed a sin and said: ‘My Lord, forgive me.’
His Lord said: ‘Did My slave know that he has a Lord Who forgives sin, and calls people to account for sin? I have forgiven My slave.’
Then as much time as Allah willed passed, then he sinned again and said: ‘My Lord, I have sinned again; forgive me.’
[Allah] said: ‘Did My slave know that he has a Lord Who forgives sin, and calls people to account for sin? I have forgiven My slave.’
Then as much time as Allah willed passed, then he sinned again and said: ‘My Lord, I have sinned again; forgive me.’
[Allah] said: ‘Did My slave know that he has a Lord Who forgives sin, and calls people to account for sin? I have forgiven My slave three times. Let him do what he wills.’”
Narrated by al-Bukhari (7507 and Muslim (2758).
An-Nawawi (may Allah have mercy on him) said in Sharh Sahih Muslim (17/75):
If the sin is repeated a hundred times, or a thousand times or more, and he repents every time, his repentance will be accepted and his sins will be erased.
If he repents from all his sins in one go, after having committed them all, his repentance is valid.
What is meant by the words of Allah, may He be glorified and exalted, to the one who sinned repeatedly – “Do what you will, for I have forgiven you” – mean: so long as you sin, then repent, I will forgive you. End quote.
So continue to repent after every sin, and be sincere in your repentance, regretting and feeling sorry for what you have committed of sin in the past, and resolving to give it up forever.
Then strive to perfect your repentance by doing the following:
Block all means that prompt you to commit this sin. This means not being alone; always be with other people, or with your wife and children.
If you must be away from your wife, try to bring her with you, and do not stay alone far away from your wife. Maintain your chastity with her, and help her to maintain her chastity.
If you are close to your wife and family, and are staying with them, then do not stay away from them. Endear yourself to your wife, and meet your needs with her. Every time you feel aroused as a result of looking at something, or as a result of an accidental glance, do not let the Shaytan prompt you to fulfil your desire in haram ways; rather hasten to do it in a halal way.
Constantly keep yourself busy with beneficial actions, whether they have to do with this world or the hereafter, because idleness corrupts the individual in a big way.
Completely disconnect your phone from the Internet. It may be more beneficial for you to change your phone, and use a phone that has no access to the Internet.
Strengthen your faith and your fear of Allah and His strict reckoning. Constantly bear in mind that He can see you and is watching you.
Read Qur’an a great deal and offer a lot of supererogatory (nafil) prayers, especially voluntary prayers at night (qiyam al-layl).
Offer a great deal of supplication for guidance, and one of the most beneficial supplications for guidance that a person can say is {Ihdina as-sirat al-mustaqim (Guide us to the straight path)}.
For more information on means that will help you to give up watching indecent films, please see the answer to question no. 210259 .
We ask Allah to guide us and you, and make us and you steadfast.
And Allah is the One Who enables us to do that which He loves is pleased with.