Nails/Bad Habits

I have a habit of picking at my toe nails and ripping them off so they are short and stubby and sometimes it’s even painful because the nails gets so low as I pick at it from either side. Any tips for dealing with habits such as nail biting or picking?