Primary production

Primary production is the synthesis of organic compounds from carbon dioxide. It occurs by photosynthesis. Light is its source of energy. It also occurs through chemosynthesis, which uses the oxidation or reduction of inorganic chemical compounds as its source of energy. 
Almost all life on Earth relies directly or indirectly on primary production. The organisms responsible for primary production are known as "primary producers" or autotrophs. They form the base of the food chain. On land, these are mainly plants; in the sea (or lakes) algae do this role. Also, there are shallow water oxygen primary producers like sea grass.
By photosynthesis or chemosynthesis, energy is used to make complex organic molecules from simpler inorganic compounds (such as carbon dioxide (CO2) and water (H2O). The following are simplified equations of photosynthesis (top) and (one form of) chemosynthesis (bottom):