Put up with unpleasantness, learn one's lesson. For example, After failing math, he had to take his medicine and go to summer school. This idiom uses medicine in the sense of “a bitter-tasting remedy.” [Mid-1800s]
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.