If you've ever discovered that you're not able to do something you wanted to do, that's a bitter pill to swallow — something you have to acknowledge but is difficult or unpleasant to accept.
Take a minute to think about medicine: Sometimes pills that you have to take taste bitter; you just have to accept it and get through it. The phrase bitter pill to swallow takes this idea and extends it metaphorically to refer to any kind of difficult experience that you have to go through. Cutting dairy products from your diet might be a bitter pill to swallow when you discover you're lactose intolerant. Repairing a newly finished floor after a broken pipe causes water damage would also be a bitter pill to swallow.