Cats usually get worms from ingesting fleas. The first thing to do is get rid of the fleas on your cat and in your house. Since there are different types of worms, you might want to have your vet examine the cat and determine which type s/he has. Your vet can prescribe a medication to treat the worms. Food grade dioatomaceous earth added to your cat's food will kill worms, but it takes time. Check for the amount to add to food for cats. Cats are very sensitive to many medications, so always ask your vet about what to use.