Anxiety can be a cause of biting your fingers and fingernails.
I have anxiety problems myself and sometimes I do bite both my fingers and fingernails when I'm nervous or anxious.
When my anxiety goes away then I stop biting my fingers and fingernails so speaking to a doctor about the reason you're biting your fingers can help.
Getting on some anxiety medication after seeing a doctor can help to curb your urge to bite your fingers.