Answer:
By the Calvin cycle
Explanation:
These kind of bacteria, the chemolithotrophs, obtain their carbon from carbon dioxide, and their energy by some reduction reactions with some chemicals like NH3, NO2, H2 or some other sulfur compounds like H2S, or S.
Since these living things do not use the sun energy as the energy source, they need to obtain from the oxidation of these reductive compounds.
Later the next step is use the Calvin Cycle similar like the plants.
Hope this info is useful.