I know the struggle. I deal with the thoughts rather than the actions now but I do know the consequences of those actions. Keep going to Confession, find time to spend in Adoration if you find that helps, and of course, pray!
I have found it helpful to pray to St. Catherine of Bologna and St. Catherine of Siena for their intercession to God regarding temptation.
Ask Mary (especially if you have a favorite title of her’s) to pray for you, frequently think of Christ throughout the day and say, “Jesus, I surrender myself to you. Take care of everything!”
Pray the “O Blood and Water” prayer from the Divine Mercy apparitions too!
Invoke the Holy Spirite and the Name of Jesus to fight off temptation.
If you are properly disposed, receive Communion and ask that through that, you will be given strength. If you’re able to go to daily Mass, do so even if you can’t or don’t receive the Eucharist.
Ask your patron saint to pray for you and find other saints who you relate to and ask for their prayers and follow their examples too.
Another idea is to get rid of things in your life that lead to these impure thoughts and then actions if there are any. Block websites if that be it, throw out magazines, get rid of bad books or movies, etc. Fill your time with hobbies, read books about saints and the Life of Christ, perform acts of mercy by volunteering or getting out in your community, and never forget to praise the Lord even when it’s hard!
Perhaps also get a Green Scapular, get it blessed by a priest, and wear it. I have a Saint Michael medal and a Miraculous Medal on mine too.
Also, pray to your Guardian Angel and St. Michael for their help!
At the first moment you seem to feel an urge or a thought, ask the Lord to take it away and help you to bear your Cross. Pray the Rosary, pray even a few Hail Mary’s to get your mind off of it and if it helps, get up and do something to get you away from wherever the temptation started!
You could probabaly add yourself to a prayer intention book or list (or prayer line) at your parish if they have one. I’m not sure if they have rules that only those who are sick at home or in the hospital can be put in there but you can check. Just ask if it’s okay because you’re struggling with some personal things.
All is possible through the Lord even when it seems like it isn’t. The Devil will try to get you to think it’s impossible or he’ll try and get you to doubt its wrong. God knows this and He wants you to come to Him with your pain and cross and ask Him for the grace to fight sin.
I know this is a lot but I’ll be praying for you! You don’t have to do all of this, find what works for you!!