The Doctor takes Bill and Nardole (over Nardole's protests) in the TARDIS to answer a distress call from a space station. The station is a mining facility, and there is no oxygen in the corridors, and almost the entire crew is dead.
The crew's corpses are still walking around, however, courtesy of their smartsuits, which control everything, including the amount of oxygen they have.
When the three of them are cut off from the TARDIS, they're forced to don smartsuits themselves. They meet up with the surviving crew members, one of whom is killed when they are attacked by the smartsuit zombies.
They manage to escape, but Bill's spacesuit glitches when they have to spacewalk, and the Doctor gives her his helmet, exposing him to open space.
When they're attacked again, Bill's smartsuit once again glitches, and they're forced to leave her behind. The Doctor, despite being blinded, comes up with a plan.
He realizes that the smartsuits are just doing what they've been programmed to do, taken to extremes: maximizing efficiency by removing the inefficient "organic components" and saving oxygen. He connects their life signs to the power core of the station, essentially making them more valuable alive then dead.
He resuscitates Bill and drops off the two surviving workers, where they'll "lodge a complaint" with the head office. When they return to the university, he reveals to Nardole that his blindness is permanent.