A cloud collapses to form a star and disk. Planets form from this disk. According to our current understanding, a star and its planets form out of a collapsing cloud of dust and gas within a larger cloud called a nebula.
The Earth is thought to have been formed about 4.6 billion years ago by collisions in the giant disc-shaped cloud of material that also formed the Sun. Gravity slowly gathered this gas and dust together into clumps that became asteroids and small early planets called planetesimals.
Subductions causes the ocean floor to sink into deep-ocean trenches and the earths plates move apart from molten rock or magma ana the earths crusts rises a departs.