If a compound accepts electrons or H atoms, it is being reduced. As point of reference, consider our oxidation of glucose. When our muscles are working hard and cannot be supplied with oxygen rapidly enough, glycolysis is operating as a pure fermentation and lactate is being produced. There is a net creation of 2 ATPs. Components play hot potato with the reducing equivalents, passing them along.
Water is the final resting place of the hydrogen atoms.
There is enzyme in cell membrane that can take advantage of this - ATPase. Exact mechanism still not known. It is not necessary to start with organic carbon, and it is not necessary to transfer the electrons onto O2. There is more variety in the microbial world. Electrons are removed from a compound and passed down an electron transport chain onto O2, which picks up protons and becomes water.