An individual cell is a small component from which living tissue is made, and there are many kinds of cells, each containing parts within them that perform various functions.
Plant cells contain chloroplasts. These little 'factories' within the plant cells use the compound chlorophyll to take the energy from sunlight, and combine it with carbon dioxide and water ... to produce oxygen and glucose (a form of sugar).
The chemical equation describing this reaction, photosynthesis, could be written this way:
This means that in each individual reaction, the chloroplast needs 6 carbon dioxide molecules and 6 water molecules, and also some sunlight energy. From these it can manufacture, by breaking down the molecules and rearranging the individual atoms, exactly 6 oxygen molecules and 1 glucose molecule.
Notice that the glucose molecule is large, containing a total of 24 atoms. It takes energy to create this big molecule, and this energy remains stored in the molecule until it is released in respiration. In this way, energy can be moved from place to place.
Other 'factories' within the cell make use of the glucose molecule; these cell parts are called the mitochondria. Each mitochondrion takes glucose, breaks it down into atoms, and by mixing it with the atoms from more oxygen, produces carbon dioxide, water and energy ... energy in a form that can be used by all cells.
The chemical equation describing this reaction, cellular respiration, could be written this way:
This means that in each individual reaction, the mitochondrion needs 6 oxygen molecules and a glucose molecule. From these, using the energy stored in the bonds of the glucose molecule, it can produce 6 carbon dioxide molecules, 6 water molecules, and a new form of energy.
Cellular respiration can use other molecules besides glucose, but it always results in carbon dioxide, water, and energy. The energy produced in this way by the mitochondria is in a form that can be easily utilized by all cells.
This energy is stored by building a special molecule called ATP, or adenosine triphosphate, in which the covalent bonds between atoms (in particular, between the phosphate components of the molecule) store a lot of energy.
Have a look at the chemical structure of ATP.
The other products of respiration, carbon dioxide and water, can be reused by the cells doing photosynthesis. The ATP is sent out to the other cells in the organism to provide them with an energy source. This is particularly important for plants, because they can't get new energy when the sun isn't out, so ATP also provides a way for them to store up energy supplies.
The tissues of the plant contain organic compounds (compounds made by a living organism), and all of these compounds contain some of the ATP the plant has made. The plant then becomes a source of energy for other organisms ... consumers, like insects or cows, which eat the plants.
Incidentally, producers can make ATP by other means that don't involve photosynthesis, or even oxygen. The process is called chemosynthesis. Bacteria, for example, can make ATP energy by combining inorganic compounds like hydrogen, sulphur, ammonia, or hydrogen sulphide.