You will not perish on account of thoughts with which you do not sympathize and from which you at least try to be freed. Only repent, & humble yourself. And God will forgive you.
For the washing away of bodily dirtiness God has given water. And for the washing of spiritual foulness, God has given the grace of the holy Sacrament of Confession. Every man, when he dirties his hands, washes them. No one says, 'I will not wash my hands anymore, because I will get them dirty again!' But why is it then that many people say, 'I will not go to Confession, because I will not sin again tomorrow!' It is clear that the enemy of our salvation is enticing us not to wash our souls, so that he can gain power over them.
In words of boastfulness and self-justification there always lie concealed contrariness and pride, from which God turns away. After sinning one ought immediately to 'flee.' But, you will say, where? To the calm haven of heartfelt repentance. Every night before you go to sleep, tell God, the Knower of Hearts, all the sins you have committed in deed, word, and thought, and believe that God receives your heartfelt repentance. At the same time try to render your heart contrite by the memory of sudden death.
To pray with self-constraint is in our power, whereas to pray with compunction depends upon God. We must pray with what prayer we can, and for our self-constraint God will give us compunction also in due time, when this is pleasing to Him.
It is vain that some unenlightened people seek the greatest evil for man somewhere else, rather than in sin. Some consider disease to be the greatest evil, others - poverty, and others - death. But neither disease, nor poverty, nor death, nor any other earthly disaster can be such a great evil for us as sin is. These earthly misfortunes do not separate us from God if we are seeking Him sincerely, but, on the contrary, they bring us closer to Him.
If the saints, who had attained passionlessless, had to be vigilant over themselves so as not to fall from their state of grace - then all the more is daily attentiveness and concern over our eternal salvation necessary for us sinners. The fact that we are still alive means that the Lord patiently endures our sins and awaits our amendment, and if someone lawfully labors for his salvation, the Lord takes him at a time when he becomes worthy of God’s mercy.
Patience reigns quietly and fruitfully in the life of the man who does not harm or endanger anyone, who is content with little and is obedient to the commandments of the Heavenly Father.