a bitter pill to swallow: unpleasant, but has to be accepted
Examples:

  • Losing my job was initially a bitter pill to swallow.

  • It's a bitter pill to swallow but a difficult cure promises the best result.