This idiom is commonly heard in both social and professional situations. The phrase dates back to the days before anaesthetics, when wounded soldiers were given a bullet or a similar solid object to clench between their teeth when undergoing surgery, in order to keep them from screaming out in pain. On the battlefield, what was mostly available was a bullet or a leather strap. So, soldiers bit a bullet to help them endure the pain of whatever surgery without anaesthesia, for example removing a bullet in a wound.
She was upset because of what happened, but she also had to bite the bullet and put on a brave face because she was at a party.
The company had a lot of money on the deal, but there was no going back now. They had to bite the bullet.