If I want to break a bad habit it is useful to use a commitment device, this is a preventative measure to limits future actions.
Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones
Takeaways from the self-help book that is designed to drive behavior change over the long term.