Oxygen can be produced from a number of materials, using several different methods. The most common natural method is photo-synthesis, in which plants use sunlight convert carbon dioxide in the air into oxygen. This offsets the respiration process, in which animals convert oxygen in the air back into carbon dioxide.
The most common commercial method for producing oxygen is the separation of air using either a cryogenic distillation process or a vacuum swing adsorption process. Nitrogen and argon are also produced by separating them from air.
Oxygen can also be produced as the result of a chemical reaction in which oxygen is freed from a chemical compound and becomes a gas. This method is used to generate limited quantities of oxygen for life support on submarines, aircraft, and spacecraft.
Hydrogen and oxygen can be generated by passing an electric current through water and collecting the two gases as they bubble off. Hydrogen forms at the negative terminal and oxygen at the positive terminal. This method is called electrolysis and produces very pure hydrogen and oxygen. It uses a large amount of electrical energy, however, and is not economical for large-volume production.