I'd say every habit has different solutions to break. It's really all about trying to find a unique way to make yourself think about said habit everyday or as frequently as it comes to you. When it comes to these below, these are my tips:
(biting fingernails, habitually typing "which" instead of "that" in grammar-sensitive texts despite knowing the difference, staying up into the small hours to the point where it's probably affecting my health, forgetting to eat/floss/shave, and a few others too)
Biting fingernails: If you're a girl (or a confident enough guy) you can paint your fingernails so that whenever you go to bite them they'll taste poor and remind you not to do so. Or if you bite individual fingernails like only the first one, you can wrap a bandaid around it. This would look more odd in public but not as weird at home)
Typing which instead of that: If this is mostly only on mobile, you could try setting your autocorrect for "which" to autocorrect to something ridiculous that you'll notice that way you take the extra second to think about it. That being said, if you don't truly know the difference you can't really fix it.
Staying up: (never heard the phrase "small hours" and thought that was pretty neat). This one's a bit harder since I'm currently trying to break it for myself as well but I know a friend of mine who was very successful in setting an alarm on here phone for 10:00 that would tell her it was time to sleep and then would set her Do Not Disturb to enable shortly after that so her phone wouldn't start bugging her.
Forgetting to eat/floss/shave: This is all about making the routine honestly. For eating, you could try setting an alarm on your phone for specific times that reminds you to eat and if you're really bad at it, try setting an extra couple after it as well. For flossing if you remember to brush your teeth, try setting the floss right in front of your toothbrush every morning that way you see the floss there and have it click in your mind that you need to do that. Honestly, I don't know about the shaving one, I can't think of anything. You could try writing a note on your mirror but that's all I got.
Another big thing is that trying to break/create multiple habits at once is very difficult, it's much easier to take things one at a time that way you can be sure that they stick. I Hope some of these help you though.