To start with, be determined. Get up one fine day and just let go off this habit. Imagine how your hands would look with long and manicured nails. Moreover, you can also polish them with pretty colours on every occasion. Use bandage to cover your nails. This will prevent you from biting them unconsciously
If it is being really hard for you, pick one nail at a time. This is a slow process but is very effective. Try chewing sugar-free gum whenever you feel like biting on something.