Stromatolites are special rock-like structures. They usually form in shallow water.
They are formed by bacteria such as cyanobacteria. There may also be other types of bacteria and single-celled algae.
The mucus secreted by the bacteria collects grains of sediment, and they are stuck together with calcium carbonate, also from the bacteria. This builds up into the structures seen in certain sea-shore bays. Cyanobacteria use water, carbon dioxide, and sunlight to create their food, and expel oxygen as a by-product.