Make them taste bad
I trust that you're talking about biting your fingernails
Some folks find it helpful to coat their nails with something that is bad tasting. Tabasco or some other hot sauce is a good choice but it really depends on your particular taste. You might also work on controlling your anxiety
through other means than nail biting.
Answer assisted by David Miller, Medical Student