pull (someone or something) out of the fire
To save someone or something from imminent or impending trouble, difficulty, or danger. My brother is the best lawyer in town, and he's pulled me out of the fire on more than one occasion! The president gets all the credit for the economic recovery, but it was really a team of international financial strategists that pulled it out of the fire.
pull something out of the fire
1. Lit. to drag or take something out of a fire before it is consumed. The fire was too big, so he pulled a few logs out of the fire.
2. Fig. to rescue something; to save something just before it's too late. Can we rescue this project? Is there time to pull it out of the fire? There is no way we can pull this one out of the fire.