If you see worms in the stool or the pup throws up worms, there are worming treatments you can buy at a pet store. However, I personally wouldn't treat for something I wasn't 100% sure about.

The best thing to do is take the pup to a vet. If you just bought the dog from a breeder, a responsible one should pay the vet bill.