Before I became Catholic, I struggled with these issues myself. I freely gave into them on a daily basis without any attempt to stop myself, and not until I began RCIA did I begin trying to stop. It was off-and-on throughout, but a couple weeks before my baptism, I just said: I’m going to stop. The temptations still came, if not stronger than before, and every little thing brought up those old feelings. After three years as a Catholic, they still are with me every day, all day, even though I have not given in to them once since my baptism.
It is incredibly difficult, but sometimes, it is just a matter of will. You must become almost stubborn about it. View it as a personal challenge, as though Satan is telling God, as he did with Job, that you are too weak and will cave in eventually. But like Job, who suffered deeply and asked God why it all was happening, he kept his faith. And if you do fall, don’t view it as a personal failure. Jesus told us to never be afraid and to never worry - about anything, including sin. St. Paul echoed this many times in his epistles. Jesus defeated sin; it has no power over His Body, which is the Church. Even when we sin, we should not worry or be afraid.
We should trust in God’s delivering mercy, get rid of it as soon as possible, and keep our eyes always on Christ. Satan wants nothing more than to distract us from God by the “glamour of sin”, as St. Francis de Sales called it (I think it was him). It is like a chocolate donut, delicious, rich, tempting, yet bad for us; while holiness is like the Eucharist - light, with almost no flavor, little feeling of bodily satisfaction, yet it is the best thing we can ever consume.
I hope this helped, I truly do, and I am so sorry you are going through this deeply painful trial. But always trust that God is in control; even in the midst of sin and evil and pain, God is there, using the sin of the world to create an even greater result, one that often seems very distant and may not even be realized in this life. But fear not - there is justice in the end.
I pray that you may always find the strength and the hope to overcome your sinful habits by keeping your focus ever on the Cross of Christ, our Deliverance from all the evils of this fallen world. I also pray that the example of Our Lady, who endured all pain and suffering without giving into sin, will inspire you to not only live a holy life, but to repent with contrition and then strive to abandon sin in favor of God’s love and truth. I pray that all this may increase your charity, especially towards those who share your problems, and that you may be forgiven all your sins. I also extend these intentions for all those in the world afflicted with sexual temptations, habits and disorders. I ask for the intercession of the Blessed Virgin Mary, your guardian angel, St. Michael the Archangel, and St. Catherine of Siena, patroness against sexual temptation. God bless.
St. Michael the Archangel, defend us in battle
Be our protection against the wickedness and snares of the devil
May God rebuke him, we humbly pray, and do thou
O Prince of the Heavenly Host, by the power of God
Thrust into Hell, Satan and all the evil spirits
Who prowl about the world, seeking the ruin of souls.
Amen.