Changing habits is difficult if you depend only on thought and reason.
Our minds are influenced by desires and attachments. When we reach a superconscious state we can change a deep-seated habit in one meditation!
Substitute something to replace the habit you wish to be rid of for a time, until the desire for it goes away.
Ask God and guru to help you establish new habits.
If a habit you want to let go of comes back, instead of saying ‘I failed,’ say ‘I haven’t yet succeeded.’