At the beginning of Earth’s history, there was no land or crust as we know it today.
Earth’s elements were still hot and in a molten state. As Earth cooled, pieces of a crust began to form at the top, much like the skin that forms on hot chocolate as it cools.
This crust material became a different compound from its parent compound (the molten liquid) as it cooled. This happens because individual elements cool at different temperatures. The material that cooled first, the oceanic crust, is called basalt.
The continental crust is more complex. It is composed of many kinds of rock that came from uplifted basalt and basalt that remelted in the molten liquid after a collision with another piece of crust.
This is similar to the top layer of hot chocolate that remelts if you stir it up. Early in Earth’s history, the remelted basalt then came to the surface in volcanoes, forming different compounds that were lighter and more buoyant than the original basalt, forming proto-continents.
This is why continents are not generally covered by water: They float on the molten liquid underneath.