A good confession of course requires the Faith!
Here is from the desert:
A brother was beset by thoughts of blasphemy and was ashamed to reveal them to anyone. Wherever he heard them there were great Elders, he visited them to disclose the thoughts to them, but, being too ashamed to confess them, always returned empty-handed. He frequently visited Abba Poiemn, and towards him he acted likewise, out of shame, without confessing anything.
Abba Poimen realized that the brother had such thoughts and was distressed and would not confess them. One day, therefore, as he was escorting him on his way, he said: "Look brother, you have been coming here for so long to reveal the thoughts yo have, yet when you come, you are reluctant to confess them, and each time you leave in sorrow, since you keep them to yourself. So tell me, what is it that bothers you?" The brother replied to him: "The Devil wars against me to make me blaspheme against God, and I have been ashamed to say so, but now I am telling you." As soon as he related the thought to the Elder, he felt relief.
...
The Elder said to him: "Do not be upset, my child, but when this thought comes to you, say: "I am not responsible for this thought. May your blasphemy be upon you, Satan. My soul has no desire for this." Whatever the soul does not want, lasts but a short time.' And the brother, went away healed.
A brother once asked one of the Fathers about the thought of blasphemy saying, "Abba, my soul is troubled by the demon of blasphemy. Have pity on me and tell me how this has happened to me and what I should do about it."
The Elder answered: "This kind of thought occurs to use because we malign, disparage, and condemn other people; or, otherwise it comes from pride, from following one's own will, from neglecting prayer, and from irritation and anger, all of which are signs of pride. For pride leads us into the aforementioned passions, from which the thought of blasphemy is engendered. If this thought lingers in one's soul, the demon of blasphemy hands one over to the demon of fornication. Oftentimes the thought of blasphemy drives a man out of his mind, and unless he comes to his senses, he will fall into perdition."
...
Question
How is it that the soul of a man frequently inwardly utters certain shameful, unclean, and foul words and entertains similar thoughts, involuntarily and unintentionally?
Oftentimes the soul also utters ungodly and blasphemous words against God. . . Others have even contemplated ѕυιcιdє. . .
Answer
Thoughts of this kind occur to many people as a result of pride. . .
Still others, who are devout and God-loving, are vexed by blasphemous thoughts because the demons envy them; for this reason, even certain holy and virtuous ascetics living in the desert fall into such thoughts. . .
The most irksome aspect of this warfare is that no one who is being tried by it dares at all to confess these thoughts to a fellow human being, reckoning that no one else in the world has such abominable thoughts.
. . .
Well there is too much to type at this point, but the above advice -- turn it back on the devil, live a virtuous and prayerful life, and go to confession this is what follows largely..