Many devout people live from time to time in a state anguished confusion because of habitual sins and faults. They find it hard to see a path to freedom from these things. In some ways it's not their fault; overcoming sin and striving for perfection aren't preached or taught about much.
Often part of the problem is the false assumption that the best way to overcome the fault or the sin is to resolve to 'stop doing x.' Sometimes this can work, but usually it doesn't. A much better strategy is look at the rest of one's life to eliminate the occasions of the sin and the subtle consents to what leads to it.
For example, if we struggle with distraction in prayer beyond any fruitful use, it's probably because we live in a distracted way the rest of the time too. When we try to live a more intentional and less distracted life generally, we will find our specific time for prayer less distracted as well.
Someone may surprise himself when he is suddenly overcome by anger, expresses it in speech, and is then sorry for what he said. It doesn't do much good to say, 'I won't get angry next time.' Better to begin to examine all of the little ways he consented to interior movements of anger, impatience, and self-righteousness before what seemed like a more serious incident occurred. The same sort of thing goes for chastity. Someone should not be surprised to find himself or herself having fallen into a grave act of unchastity when he or she has been consenting to small, interior acts of selfishness and consenting to little movements of lust all along. And yet, because we often don't examine ourselves and attend to our thoughts and feelings as they arise, we are surprised and don't understand when we fall into serious sin.
Any recovering addict will tell you that a slip into picking up the drug of choice is consented to in the will long before the actual incident.
I was just considering these things when I read some very simple advice on this topic from Fr. Theodosius Foley:
"As habits are made up of single acts, so our character is formed by our habits, and character is what influences our destiny here below and hereafter. A war is not won by superb action at the time of crisis, but by foregoing training. Our conduct in the less struggles of life determines how we shall act in the heat of battle."