Temptation. Pray, thank God you have not fallen yet since last time. Apologise for your curent temptation. Ask him for the grace to continue on.
If it persists, ask, is this thought habit or new. Habit happens in thought, actions merely follow. You also know where habitual thoughts go. If habit, disengage, it is not 'thought', but repetition, thoughtlessness.
If it remains strong, know our minds are analogue, not digital. Ask what the thought symbolises to you, what its meaning is below what you think. It is a symbol of something else, other desires or concerns. Address those symbols, but engage meekly, and pray to God, thanking him and asking for grace.
If it persists, distract yourself, focus on something else. Remember that you cannot fight future battles, only your present one. Often we push ourselves into temptation by living in a thousand futures that may never happen. Turn to prayer, even pray out loud.
Life oscillates between strength and weakness, awareness, and sleep, easy and difficult. Both difficulty and ease will come and go. Staying firm despite both is the virtue of fortitude. Don't try to argue with your devils, you would not be aware that your temptation were wrong if you did not know those arguments will only work, because you have oscillated into a stage of weakness, and not against your sound and logical mind.
If you fall, immediately apologise to God for disappointing him, and ask his strength to again pursue good. Don't wait for confession to repent, confess later, but repent that moment.
Have faith in God, and start the fight to serve him again that very moment. Despair is a weapon the devil loves to use against us. Hope, real hope, is a power from God. Pray. Thank God for his grace, and for giving you repentance, yet again, and ask that you continue to walk in it. God does not judge you by who you were yesterday, he cares about who you are today.
Fight those battles you can fight, any one you see you are able to. Take your opportunities. Those which may not be there tomorrow.
Fight in the present, and be always aware of where life's currents drag you to. You build today what tomorrow can behold, you strengthen your defences tomorrow, through present actions. You build virtue tomorrow, by forming habits of good virtue today, whenever you have the opportunity to.
Present resolve is strong, future resolve is only as strong as the present resolve of each day you face. God gives us our daily bread, like he gave heavenly bread to the Israelites in the desert, enough for our present needs, but nothing secures against the future, which winds about out of sight and predictability. We get each day, now, we only get tomorrow tomorrow.