One thing I've heard is to simply video yourself biting your nails so you can see what others see.
You will be shocked at how gross it appears to others. For some people this can be enough to make them stop. Other things include putting something bitter or sour on your nails. Best of luck.