Most limestones form in calm, clear, warm, shallow marine waters. That type of environment is where organisms capable of forming calcium carbonate shells and skeletons can thrive and easily extract the needed ingredients from ocean water.
When these animals die, their shell and skeletal debris accumulate as a sediment that might be lithified into limestone. Their waste products also contribute to the sediment mass.
Limestones formed from this type of sediment are biological sedimentary rocks. Their biological origin is often, but not always, revealed in the rock by the presence of fossils.

Sometimes evidence of a biological origin is destroyed by the action of currents, organisms, dissolution, or recrystallization.