“In the beginning God created the heaven and the earth.” Genesis 1:1
Notice how God’s first sentence involved declares that atheism, pantheism, fatalism, materialism and evolution are all dead wrong. It is taken for granted the God exists, that He is one God (opposed to “gods” or “the gods”), that He had a specific plan of creation that He is personally involved with His creation (read verses 1-31), that He created all matter, and that all of this happened suddenly, rather than evolving over billions of years.
“And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.” Genesis 1:2
What happened in Genesis 1:2 is further described in 2 Peter 3:5-6, “For this they willingly are ignorant of, that by the word of God the heavens were of old, and the earth standing out of the water and in the water: Whereby the world that then was, being overflowed with water, perished:”
So the flood in 2 Peter 3:5-6, is not the flood of Noah but is the flood of Genesis 1:2. Note the “waters” in Genesis 1:2.