We can probably all think of at least one bad habit that we would like to break. The first step in breaking a bad habit is of course to identify the habit you wish to break.
After you have identified it, try and understand more of why you do it. When did the habit start and why? What do you gain from doing it?
If you can understand why you have this habit and what it does for you - it will be much easier to break. For example, if you bite your nails because you are nervous - you could identify the specific things or situations that make you the most nervous and try to find an alternative that might have the same or a similar effect on you. In this case, instead of biting your nails, maybe you could get a fidget toy to bring with you to keep your hands busy. That is one method.
Another method would be to do something to prevent yourself from doing the bad thing - to deter yourself away from it. Again, in the case where one is trying to stop biting their nails - instead of finding an alternative - they could paint their nails or put something on their hands (like a strong lotion or hand sanitizer) and this way when they go to bite their nails - there will be a foul taste.
Of course, you could do a combination of the two methods (finding a replacement for the behavior and trying to trick your mind with negative reinforcement).
Another helpful tip I have to share is to tell a close friend or someone you trust about your desire to quit this habit. Having someone that knows about it is beneficial because they can check in with you and help hold you accountable.
Good luck on kicking that bad habit!