Oxygen is used in Oxidative Phosphorylation to form water.
Reduced NAD and reduced FAD (made in glycolysis, link reaction and krebs cycle) are used in the electron transport chain to supply an electron, and also give a proton, which will be pumped into the inter membrane space of the mitochondria.
Basically the electron transport chain pumps the H+ into the inter membrane space in order to create a electrochemical gradient. This is used to generate ATP using ATPsynthase. The oxygen is used in order to take the H+ away from the cell so there is still an electrochemical gradient, in the reaction shown below.
4H+ + 4e- + O2 -----> 2H2O
The electrons are supplied by the electron transport chain.
The electrochemical gradient is key in maintaining the production of ATP.