In Genesis 1:2 the Earth "was without form, and void." The precise meaning of this wording is unclear since the original Hebrew phrase Tohu wa-bohu (תֹ֙הוּ֙ וָבֹ֔הוּ) is ambiguous. It is usually worded in English as "waste and void," "formless and empty," or "chaos and desolation." Whole books have been written about this phrase alone, examining the translation of the original Hebrew Scripture .
One key question revolves around the word "was" or הָיְתָ֥ה in Hebrew. This word leaves open whether the Earth began at the absolute beginning of time or if it came into being after some intervening event. Either way, the views of our early planet as either developing over time or redeveloping in cycles is consistent with modern science. Today, astronomers are able to observe this process with planets, stars and entire galaxies being born, dying and reborn from the dispersed elements of the universe. The wisdom of the ancient Scriptures has been proven accurate by modern technology.
From this empty state of the world, "the Spirit of God moved upon the face of the waters." The Hebrew word for "Spirit", וְר֣וּחַ can mean "wind", "breath", "life" and "a region of the sky" among other things. As later verses of the creation story will attest, the Spirit of God marks a key transition state from "nothing" to "something". The word for "waters", הַמָּֽיִם׃ in Hebrew, signifies liquids including body fluids and figuratively as "transition" and "refreshment." This is a key inflection point of the coming into being of a young Earth and life as we know it.
To learn more about what Genesis 1:2 means in detail, with the translation and meaning of every word from the original Hebrew scriptures, see https://www.quotescosmos.com/bible/bible-verses/Genesis-1-2-without-form,-and-void.html