Well, i can give you a few prayers to help -
when such things come to mind, immediately pray - “Precious Blood of Jesus Christ, wash over me, protect me from the wickedness and snares of the devil”
and then try to think of something else, like something you enjoy, just to get your mind off it, do anything(moral) that will distract you.
never neglect to ask God for help when those thoughts enter your mind, or if you are aware of what triggers them in the first place, try to remove yourself from that.
another prayer you can pray is the “Prayer to Our Lady for mental peace”
O Mother of tranquility, Mother of hope, Our Lady of mental peace, we reach out to thee for
what is needful in our weakness. Teach a searching heart that God’s love is unchanging, that
human love begins and grows by touching His love. Our Lady of mental peace, pray for us!
and here is a “Prayer against evil thoughts”
Almighty and everlasting God, look favorably upon my prayer and free my heart from
temptation to evil thoughts, that i may deserve to be accounted a worthy dwelling place
of the Holy Spirit. Shed upon my heart the brightness of Thy grace, that i may ever think
thoughts worthy of Thy Divine Majesty and that are pleasing to Thee and ever sincerely
love Thee, through Christ Our Lord. Amen.
And a prayer to Saint Dymphna for those with mental and nervous disorders -
O Lord God, Who has graciously chosen St. Dymphna to be the patroness of those
afflicted with mental and nervous disorders and has caused her to be an inspiration
and a symbol of charity to the thousands who invoke her intercession, grant, through
the prayers of this pure, youthful martyr, relief and consolation to all who suffer from
these disturbances, and especially to those for whom we now pray. (Here mention
oneself or names of other.)
We beg thee to accept and to satisfy the prayers of St. Dymphna on our behalf. Grant
us patience in all our suffering and resignation to Thy Divine Will. Fill us with hope,
and if it be in accord with Thy divine plan, bestow upon me (him, her) the cure i so
earnestly ask for. Through Christ Our Lord. Amen.
other means to try and fight or banish these bad thoughts, are praying and meditating on the mysteries of the rosary, reading and meditating on the bible, reading other good catholic books,
also, if you have holy oil, you can bless yourself with it by making a cross on the forehead, and praying by blessing yourself that your evil thoughts may be erased, or to be protected from them.
if you don’t have a scapular, get one, have it blessed(get enrolled) and wear it always,
other than that, just pray, be patient, and don’t worry, because God doesn’t want you to worry, that is what the devil wants, but you have no need to be afraid, God will help you, and remember that as long as you are fighting these bad thoughts, then you are not sinning,
do what you can, even talk to your priest about it,
and i’ll pray for you to,
alright, take care, hope this helps.