Cats can be fickle creatures. One moment they cuddle up next to you and the next, they’re slashing your jugular vein open with their razor sharp claws. The basic problem is learning how to live with a cat in a way that the cat likes. In other words, you have to adjust your life to make the cat happy.
Do what the cat wants, not what you want, and then you’ll find that your cat will be happy. Ignore the cat’s wishes and you’ll find that you won’t be happy either, especially if you have blood dripping out of your open wounds.