Cats usually bite people because of teeth grinding period, and of course they may also simply want to bite people.
If you don’t want to be bitten by a cat, then you should educate the cat well. When the cat bites you, you can pretend to be hitting him, use a palm in the void, or raise the volume and roar.

I am willing to bite the cat. Rather than biting, it is actually grinding my teeth. This requires teaching, letting the cat know where the biting is. When my cat bites people for the first time, I will make a very painful "hissing" sound, and then my cat (surprised face) will spit it out after a while and leave. I do this every time the cat bites me.

In addition, you can try tooth grinding sticks and tooth grinding cookies. But in my personal opinion, sometimes it’s just a cat just trying to bite you.
Some cats may have hurt it or touched its sensitive parts and will bite you lightly, but in fact it doesn't hurt and will let go in a while.
So for cats to bite people, you must first understand whether you believe in your cat or not, and whether you are willing to let the cat bite. (ps: I don't really make a ruthless rant)
