Nail-biting is a 'control pattern' - i.e. something you do to stop the effects of bad feelings. There are lots of control patterns: jiggling your leg, wringing your hands, sniffing, fiddling with something, smoking, talking too quickly or too slowly, eating and drinking when not hungry, being busy instead of relaxing, overworking and so on.
The best way to overcome a control pattern is to find someone you can talk to about your worries and concerns, without being interrupted or ignored.