When magma cools and solifies.
From pieces of other rocks or pieces of living things.
When heat or pressure changes the original rocks.
Coal and gypsum.
Granite and bassalt.
Marble and slate.