I learnt that unlearning a habit requires substitution. So for me to stop a vice, I should work on finding an adequate replacement for the vice.
For that, it might be important to know what void the current habit is filling in my life. For instance, if scrolling on social media helps me avoid boredom, I will be better informed on what substitutes may take its place and start creating a distance from the old habit.
Of course, the journey might not be easy, but being aware might help me stop, take a breath, and then reassess what to do. Then, over time, I can learn that grabbing an apple serves the same purpose as the sweet, with the added benefit of healthy eating.