One of the toughest vices that people have in their lives is the demon of lust. This insidious character causes people to desire the things of the flesh over God's gift of eternal life. It inhabits our minds 24/7/365 in a lot of cases.
But it can be beat. It will take lots of prayer and fasting. Why fasting? Because as St. Thomas Aquinas says, the food organ (stomach) and the sex organs are right next to each other in the body, and one affects the other somehow. So by starving the stomach, our desire for porn, masturbation, and fornication is eased.
A very strong devotion to the Mother of God, the Blessed Virgin Mary, is also paramount here. The more rosaries you say, the more this demon of lust disappears, because where Mary is, the demons cannot be.
One thing that exorcists tell us is that demons HATE Gregorian Chant. So if your computer is your gateway to your lust, try playing Gregorian Chant (youtube has lots of this) in the background while you surf the internet.
The following is advice from St. John Cassian...Please read this, and then do everything you can to avoid hell on earth, and then hell forever after death...
On the Demon of Unchastity and the Desire of the Flesh
"Our second struggle is against the demon of unchastity and the desire of the flesh, a desire which begins to trouble man from the time of his youth. This harsh struggle has to be fought in both soul and body, and not simply in the soul, as is the case with other faults. We therefore have to fight it on two fronts.
Bodily fasting alone is not enough to bring about perfect self-restraint and true purity; it must be accompanied by contrition of heart, intense prayer to God, frequent meditation on the Scriptures, toil and manual labor. These are able to check the restless impulses of the soul and to recall it from its shameful fantasies. Humility of soul helps more than everything else, however, and without it no one can overcome unchastity or any other sin. In the first place, then, we must take the utmost care to guard the heart from base thoughts, for, according to the Lord, 'out of the heart proceed evil thoughts, murders, adulteries, unchastity' and so on (Matt.15:19).
We are told to fast not only to mortify our body, but also to keep our intellect watchful, so that it will not be obscured because of the amount of food we have eaten and thus be unable to guard its thoughts. We must not therefore expend all our effort in bodily fasting; we must also give attention to our thoughts and to spiritual meditation, since otherwise we will not be able to advance to the heights of true purity and chastity. As our Lord has said, we should 'cleanse first the inside of the cup and plate, so that their outside may also be clean' (Matt. 23:26).
If we are really eager, as the Apostle puts it, to 'struggle lawfully' and to 'be crowned’ (2 Tim. 2:5) for overcoming the impure spirit of unchastity, we should not trust in our own strength arid ascetic practice, but in the help of our Master, God. No one ceases to be attacked by this demon until he truly believes that he will be healed and reach the heights of purity not through his own effort and labor, but through the aid and protection of God. For such a victory is beyond man's natural powers. Indeed, he who has trampled down the pleasures and provocations of the flesh is in a certain sense outside the body. Thus, no one can soar to this high and heavenly prize of holiness on his own wings and learn to imitate the angels, unless the grace of God leads him upwards from this earthly mire.
No virtue makes flesh-bound man so like a spiritual angel as does self-restraint, for it enables those still living on earth to become, as the Apostle says, 'citizens of heaven’ (cf. Phil. 3:20). A sign that we have acquired this virtue perfectly is that our soul ignores those images which the defiled fantasy produces during sleep; for even if the production of such images is not a sin, nevertheless it is a sign that the soul is ill and has not been freed from passion. We should therefore regard the defiled fantasies that arise in us during sleep as the proof of previous indolence and weakness still existing a us; since the emission which takes place while we are relaxed in sleep reveals the sickness that lies hidden in our souls. Because of this the Doctor of our souls has also placed the remedy in the hidden regions of the soul, recognizing that the cause of our sickness lies there when He says: 'Whoever looks at a woman with lust has already committed adultery with her in his heart' (Matt. 5:28). He seeks to correct not so much our inquisitive and unchaste eyes as the soul which has its seat within and makes bad use of the eyes which God gave it for good purposes. That is why the Book of Proverbs in its wisdom does not say: 'Guard your eyes with all diligence' but 'Guard your heart with all diligence' (Prov. 4:23), imposing the remedy of diligence in the first instance upon that which makes use of the eyes for whatever purpose it desires.
The way to keep guard over our heart is immediately to expel from the mind every demon-inspired recollection of women - even of mother or sister or any other devout woman - lest by dwelling on it for too long the mind is thrown headlong by the deceiver into debased and pernicious thoughts. The commandment given by God to the first man, Adam, told him to keep watch over the head of the serpent (cf. Gen. 3:15. LXX), that is, over the first inklings of the pernicious thoughts by means of which the serpent tries to creep into our souls. If we do not admit the serpent's head, which is the provocation of the thought, we will not admit the rest of its body - that is, the assent* to the sensual pleasure which the thought suggests - and so debase the mind towards the illicit act itself.
As it is written, we should 'early in the morning destroy all the wicked of the earth' (Ps. 101:8), distinguishing in the light of divine knowledge' our sinful thoughts and then eradicating them completely from the earth - our hearts - in accordance with the teaching of the Lord. While the-children of Babylon - by which I mean our wicked thoughts - are still young, we should dash them to the ground and crush them against the rock, which is Christ (cf. Ps. 137:9; 1 Cor. 16:4). If these thoughts grow stronger because we assent to them, we will not be able to overcome them without much pain and labor.
It is good to remember the sayings of the Fathers as well as the passages from Holy Scripture cited above. For example, St Basil, Bishop of Caesarea in Cappadocia, said; 'I have not known a woman and yet I am not a virgin.' He recognized that the gift of virginity is achieved not so much by abstaining from intercourse with woman as by holiness and purity of soul, which in its turn is achieved through fear of God. The Fathers also say that we cannot fully acquire the virtue of purity unless we have first acquired real humility of heart. And we will not be granted true spiritual knowledge so long as the passion of unchastity lies hidden in the depths of our souls.
To bring this section of our treatise to a close, let us recall one of the Apostle's sayings which further illustrates his teaching on how to acquire self-restraint. He says; 'Pursue peace with all men and the holiness without which no one will see the Lord' (Heb. 12:14). It is clear that he is talking about self-restraint from what follows: 'Lest there be any unchaste or profane person, such as Esau’ (Heb. 12:16). The more heavenly and angelic the degree of holiness, the heavier are the enemies' attacks to which it is subjected. We should therefore try to achieve not only bodily control, but also contrition of heart with frequent prayers of repentance, so that with the dew of the Holy Spirit we may extinguish the furnace of our flesh, kindled daily by the king of Babylon with the bellows of desire (cf. Dan. 3:19). In addition, a great weapon has been given us in the form of sacred vigils; for just as the watch we keep over our droughts by day brings us holiness at night, So vigil at night brings purity to the soul by day. "