How can I deal with porn addiction?
You cannot stop sinning just by wishing for it or by trying to use your willpower. That never works. You must instead try to become the type of person who needs no effort to avoid sins. And this can only be achieved by setting aside an hour or so every day for extra worship (Quran-reading and praying).
Being unable to stop sinning is a sign that you are distant from God. The sinning is just a sign of a bigger problem. And the solution is to come closer to God. Once you achieve this, you will automatically avoid sinful things without having to think about it. Stop worrying about sins (God forgives all sins) and start worrying about your relationship with God.
For more details please see my essay God has not abandoned you
The short answer is that if you do sufficient worship and Quran-reading so that the afterlife feels more important than the present life, or as important, then giving up any sin becomes the easiest thing in the world. Your problem is not porn, but the fact that your heart is not sufficiently soft, humble and submissive to God. This is the problem that needs to be fixed, and the fixing of it is through dedicating at least an hour of every day to voluntary worship, whether it is through reading the Quran, or praying extra prayers, or sitting after every obligatory prayer in supplication.
Once you continue on this path for a few days, your heart will soften and become submissive, and your awareness of God’s nearness will increase, and your eagerness to seek to serve Him through good deeds will increase as well, so that you enter a state where sins become unthinkable.
Always ask yourself how important the afterlife feels to you. If it feels faraway and unimportant, you have failed at keeping God’s remembrance alive in your heart, and this is what you must work to fix. You know you have reached the necessary state of piety when your record of deeds feels like a real object to you. You think about adding good deeds to it, and worry about the sins recorded on it, so that you continuously ask for forgiveness, since you can never be sure if God has forgiven all of your sins.
Once the afterlife feels so real that it is not just an intellectual idea, but something that causes emotions in you (thinking of Paradise makes you feel excited with joy and longing, and thinking of the Hellfire causes you fear), then you know that you have finally managed to balance the present life with the afterlife.
Being addicted to any sin can only come about when one is attached to the present life, when the afterlife is nothing but a faraway idea, rather than a real, living and breathing thing that is only a heartbeat away. This is the disease that needs to be cured, and curing it will cure all sins, not just a particular sin.
Therefore do everything you can to cause the afterlife to feel real in your heart. Read the Quran, supplicate to God, and continue praying, until your heart submits.
And repeat that every day. This is nothing something that you can accomplish and leave its trophy on your shelf. Faith is something that needs to be continuously recharged, every day of your life. You must work every single day to keep the afterlife real in your heart. Every morning will be a new day in which the afterlife will fade from your heart, and you must exert daily effort to recreate its reality. Without this, no matter what short-term success you achieve in avoiding sins, you will always fall back into it.
God will not burden you with more than you can bear. If you cannot stop it, then make up for it by asking for forgiveness, reading Quran, and praying tahajjud.
Always remember this verse of the Quran: “We have not placed any hardship for you in (this) religion.” (22:78).
There are no clear texts (Quran or hadith) that deal directly with watching porn. This is a matter of conscience between you and God. God is a kind and understanding master, and He knows you better than yourself. If you cannot stop, then continue returning to Him in repentance, He will see your sincerity and your efforts, and that is what matters.
In ten years, when your hormones have calmed down, you will find it much easier to resist this sin.