Asteroids are also rich in carbon, too, which can be used in rocket fuels, e.g., hydrocarbon fuels. Many lunar development schemes propose using substitutes for the hydrogen, e.g., powdered aluminum, which would still be mixed with oxygen for combustion. Aluminum powder based engines have been researched dating back to the Apollo days when NASA planned to develop the Moon, but the technology hasn't been developed yet for in-space applications and indeed has been shelved without an application in today's Earth launch world. The first step is in production of hydrogen and oxygen is extraction of water from the asteroid. All that's needed is to deploy a solar oven, e.g., an array of foil mirrors focussed on a tank.
Asteroidal material is put in the tank and heated.
Pipes from the oven lead to a series of very cold tanks in the cold shadows of space, which trap the volatiles in tanks. Since they liquify at different temperatures and pressures, they are easily separated from each other. This method should produce enough free hydrogen and free oxygen to fuel the return spacecraft. If not, then the water can be split up into hydrogen and oxygen by electrolysis, again an old technology. If desired, hydrocarbon fuels can be collected and used, or manufactured from the hydrogen and carbon.