For addictions I've wanted to get rid of I have:
1. Keep a spreadsheet of the hours I have spent on the activity, or
2. Kept a running log of how many days I have not done the activity - goal is usually 28 days
It helped me get off social media, and computer game addiction and a news site I didn't want to follow. I've used it successfully for alcohol too (but I was never a huge drinker).
I also used it to try and promote good behaviours too
Does the desired behavior continue after the initial 28 day period?
One problem I encountered when I tried to change my behavior using similar methods is that I don't know how strict I should be with myself. For example if I don't want to quit playing games entirely, and I'd like to enjoy the occasional game, I might set some soft limits, but that opens the door for a relapse in the future.
Or do you find that even temporary abstinence is worthwhile, even if the bad behavior comes back after some time?
I think that temporary abstinence is worthwhile - because what will happen is you find new ways to fill that time. And those new things will really be what helps you move on ultimately.
But yeah, you might relapse, it can be hard if you enjoy the activity a lot. But after you've had your fill it should be easier to walk away/ do another 28 days!