When visiting neighbors who have cats you are likely to run into 2 kinds. The pets that are friendly, like people and want interaction with them and the ones that want to be left alone. Cats are very friendly when treated the right way as kittens, just like people. These felines will bite and scratch if irritated enough. Do you not defend your yourself or get angry when irritated? For the most part they are very friendly. The problem pets come into the picture for many reasons.
One reason a cat may not like attention, avoid people and hate being picked up is lack of proper tending to when it was a very young kitten. When you get a kitten for a pet, you should pay a lot of attention to it. Pick it up and hold it every chance you get. This will lead to your pet wanting to be held and paid attention to. It will become a lap cat. It will sit on you lap while watching TV. It will climb onto your bed and lay on your chest for some loving. Your cat will generally be a happy camper all around.
Another reason a cat may not like people is abuse. If as a kitten it was abused by being treated badly, mishandled or a young child or someone else was just plain mean to it, they will not want any parts of humans. You should supervise young children when a kitten is introduced into the household as a pet. Teach the child to be kind to animals.
A stressed out cat can turn and bite or scratch you to. The cat may be used to a nice quiet house. You may have a party and people wanting to pick up the cat. All the noise and the extra people may make your pet stressed and more apt to not want to be paid attention to. Usually the cat will find a place where it can hide until the situation is back to normal. On the other hand, if has been brought up to be a friendly cat and like people, it just may be a social part of the party.
Just like people, if cats are sick they want to be left alone. When you are sick do want people disturbing you? You want to be left alone until you feel better. If a cat is sick, they will feel the same way. They will bite you and scratch you if they are sick and do not want to be bothered.
One thing you might want to do is trim your cats claws. Keeping them trimmed will reduce the pain that these feline legs can dish out. It will not hurt you as much as really sharp unattended to claws would. You will be able to enforce some discipline easier by knowing the cat will not take a big chunk of your skin off with one swipe.