Psalm 141 has a good plan of action for us to combat sin.
Call to God - ask Him to come quickly.
Ask God to guard your mouth - to watch what you say. Don't let your words make your sin worse.
Pray verse 4. At times we can easily be drawn into sin. It's a different sin for each of us. But our old sin nature can still pull our heart strings. The Apostle Paul wrote quite a bit about his struggle with sin. Romans 7:14-25
21 I find then the principle that evil is present in me, the one who wants to do good.
Have some good friends in your life - friends that you can share your struggles with. Give your friend permission to confront you when he/she sees you headed down the path to sin. (See verse 5)
You don't have a friend like that? You have to work to BE a friend like that and to develop that kind of friendship. That's a whole other blog post....
Psalm 141:4 reminded me of the third verse of the great hymn "Come, Thou Fount of Every Blessing."
O to grace, how great a debtor
Daily I'm constrained to be.
Let thy grace, Lord, like a fetter,
bind my wondering heart to Thee.
Prone to wander, Lord, I feel it,
Prone to leave the God I love;
Here's my heart, Lord, take and seal it,
Seal it for Thy courts above.
Here's a modern version of this great hymn with some new words added.