If you're looking for a way to stop this behavior, you grab them by the scruff of their neck. Don't worry, it doesn't actually hurt the cat. But it does trigger senses in them that they're being disciplined. So you grab the scuff of their neck, and act like your wrist is hurt. (the one they were biting/clawing, not the one you're using to grab the scruff of their neck).
Once they realize they're hurting you, and also realize you can grab them by the scruff of their neck, and are therefore more powerful than them, they'll stop doing that.
Of coarse, this is also assuming you're being a good cat parent to begin with. I see so many videos online titled "Cats go crazy" or something similiar. They aren't going crazy. Their humans are usually doing some shit to repeatedly piss off their cat. And eventually the cat says "FUCK THIS!!!" and lashes out.
As long as the cat routinely feels safe, and loved with you, the scruff thing works. If your cat feels unwelcome in it's own home, yes, it will lash out.