“Bailing out” is what airplane passengers do if they’re fortunate enough to have a parachute when the plane they’re on is in trouble.
A person in jail may also be able to “bail out”, with the necessary cash and the permission of the court.
The point is, if we’re in a place from which we have to bail, we have gotten ourselves into a bad place.