Keeping your cat healthy is important. Occasionally that may mean having to give your cat pills.
For some cats it is helpful to wrap them in a blanket to keep them from being able to get escape from your grasp or to scratch you.
Some cats will be fine with taking pills but some won’t like it at all. If you cat is very difficult you can trying putting the pill in food. Put it in some soft treat you occasionally give them and they will often take it without any problems but be careful to make sure they eat the pill.
If that won’t work, ask your veterinarian, if it is ok to crush the pill and put it in wet cat food. Some pills can’t be safely taken this way so check with a vet first.