Changing old habit means that every time the emotion arises, you try to be aware, try to be aware, and try to be aware.
When you do that, you’re not continuing to cultivate the old habit pattern. You’re trying to change to a new habit.
How? We think the right way and try to be aware; then, the mind cannot go back to the old habit.
Slowly, when awareness gets better and better and wisdom is stronger, some understanding could arise and that’ll change the idea.
Only when awareness gets stronger, then wisdom may be able to see the cause of the defilement.
You need to cultivate the awareness, samadhi, and wisdom – that’s what you need to do.
If wisdom has grown, it’ll do its job (see the cause of the defilement).