It sounds like you're talking about the Bussard Ramjet. It collects interstellar hydrogen gas for use in fusion engines. The problem is that it's unlikely there's enough hydrogen floating around for it to really work.
There's also nebulae. But that's only going to be useful when you're actually in a nebula, which isn't most of the time.
IIRC, a Bussard Ramjet is at least potentially viable at the typical density in the galaxy, but unfortunately for any use by humans to get away from our solar system, or local region of space (to a distance, IIRC, on the order of 1000 light years in any direction) is a pocket of relatively low density.