The phrase
"to take one's medicine" means to accept and face the consequences or unfavorable situations that one has caused or is going through, often referring to something that is unpleasant or difficult but necessary for personal growth or improvement.
Full definition