Approximately 4.54 billion years ago, Earth formed through accretion of cosmic material in the solar nebula. Gravitational collapse caused dust and gas to coalesce into a spherical protoplanet. Heavier elements like iron and nickel sank to form the core, while lighter materials remained near the surface. This process generated heat from gravitational compression, radioactive decay, and impacts. Early Earth was likely covered in magma oceans with an atmosphere of hydrogen, water vapor, and gases released through volcanic outgassing.