>>25498887
i didn't mean the literal center of the earth, just relatively deep underground. crystals are just chemical bonds between atoms. they form in seemingly neat shapes because it allows the structure to be maximally stable.
salt crystals can be formed quite easily since it just requires you to evaporate saltwater.
the gem or metal crystals you see usually form under magma. there are mineral deposits under this magma. when minerals are heated, their atoms/molecules are agitated, and they form bonds with themselves (mostly ionic iirc) to minimize their their energy.
then, tectonic movements help them reach the surface over long periods of time.