The earth broke off about 4.5 billion years ago with an explosion.
It was a burning hot white mass of gas and dust.
Over a long period of time, dust and gas gradually condensed to form solid rock.
Such condensation and shrinking made the earth heat up so much that the rock melted into a gluey liquid.
After millions of years, the outer surface of the earth or the earth’s crust cooled and formed hard rock again, just as melted chocolate or wax solidifies upon cooling.
The interior of the earth is still very hot.
The crust of the earth was formed from cooling and hardening of the molten matter and hot gases.
With cooling of the earth the crust hardened and formed the land.
Cooling of the earth also condensed water vapour into liquid water filling the depressions to form seas.