Sinful thoughts and emotions arise from our fallen nature. But when sinful thoughts and emotions begin to come constantly and insistently, this is a sign that they are brought by our enemy, by the fallen angel, or else that he is forcing our fallen nature to multiply them especially. Such thoughts and emotions should be confessed to our spiritual father as often as they occur, even though the confessor may be a simple-hearted man and not noted for sanctity.
Your faith in the holy sacrament of confession will save you; the grace of God present in the sacrament of confession will heal you. By constant and persistent attacks upon us the fallen spirit tries to sow and grow in us the seeds of sin, to habituate us to some form of sin by frequently reminding us of it, to arouse in us a special propensity for it, and to turn this form of sin into a habit as if it were a natural property. A sinful habit is called a passion (or vice); it deprives a man of freedom and makes him a prisoner, a slave of sin and of the fallen angel.
Against the persistent and repeated attacks of sinful thoughts and emotions, called in monastic language conflict, there is no better weapon for a novice than confession. Confession is almost the only weapon for a novice in time of conflict. In any case, it is the most powerful and most effective weapon. You should confess as often as possible during temptations caused by the devil; confess until the devil and the temptation caused by him leave you. The devil loves to act secretly; he loves to be unnoticed, not understood. “He lurketh in secret like a lion in his den, that he may ravish the poor,”
St Ignatius Brianchaninov, The Arena chapter 33