Hello, Susiq
You can give a dog pepto bismol to help. Just give 1 tbsp per 25 pounds of body weight.
Since it is confirmed he has worms, that is probably what is causing it. Give the meds the vet gave you some time. I am sure it will go away once the medication has done it's job.
Sincerely, XXXXX
Expert in cat behavior and health
Expert in cat medical and behavior issues.