A fossil is a naturally-generated underground structure resembling the remains of a large ancient creature.
Fossils can be found buried underground on rare occasions in desert and swamp biomes. They are composed of several bone blocks arranged in the shape of a giant spinal column, rib cage, or skull. Some of the bone blocks may be replaced by coal ore. Fossils are a good source of bones for players in peaceful mode. These will also generate in soul sand valleys exposed in the ground when 1.16 is released.
A fossil's generation does not depend on the Y level as it can generate at any depth, as long as it's underground.