For most habits you start by slowly stopping or slowly decreasing the amount of how much you do this habit and you try to find other things that help you not want to do it as much. Also you could find someone to talk to or go to a therapist and they could give you more options and id there are reasons you do these things there may be medication or other ways to help solve it.