The major cause of tapeworms is eating fleas. Treatment consists of an oral tablet or injection given by your vet.
The best prevention of tapeworms is keeping fleas off your pet. There are a few topical monthly flea preventatives that are successful and safe for the pet.