If you have to take an antibiotic, should you take a probiotic, too?

all i know about probiotics comes from annoying yogurt commercials.
and this one time i saw they were selling PILLS of the stuff in pharmacies.