The only surefire way is with a SCBA Setup (Self-Contained Breathing Apparatus) like firemen wear into a burning building. You could filter out the Particulates, but the CO (Carbon Monoxide) is really not filterable at the personal level. Same with CO2. You can scrub it, like the Nuke Subs do,with Lithium canisters, but not really on the personal level. Same with many of the Combustion Product Gases, which are Many, varied, and mostly carcinogenic, especially if any Plastic, or Polymers are burning. Much better to have Alternative Air sources, and close off the Intakes, that are bringing in the BAD stuff. This is exactly why FIRE, on a Submerged Sub, is so deadly, and everything possible, is done to surface and ventilate, should a FIRE break out. Confined Space, with BAD Air = DEAD, and right quick.