Essentially, every habit was once just a thought in your mind. Every thought turned into a feeling, an intention, then a one-time action. That one-time action then turned into something repeated many times and thus, became a habit of yours. This is valid for both good habits and bad habits.