Genesis 2:8-9 is topical, not chronological. God planted a garden on the third day, and man was created on the sixth day. Since the garden was made for the man, then that's how it's described.
God can't abide sin, he can't look on it. Yet in order for free will to be a possibility, sin has to be possible. How does a perfectly pure and righteous God create a world where evil exists? He became sin for us.
Water is the essence of free will which is why God used it as the raw material for the universe. God's goal was to create sentient life that had the ability to accept or reject Him as creator based on the testimony of the creation itself.
God *could* have created a perfect world, and He *could* have made companions who were as pure as the matter which he *could* have made from nothing, but he didn't. He created a corrupted world from water.
When God said, let light be, the sacrificial lamb was slain from the foundation of the world. That's why it went dark at the end of the first day, the second occurrence of darkness that we have to account for called night.
Light and darkness have to be separated because the manifestation of free will is only possible by combining them.
The nature of free will is such that an individual can choose light or darkness. How can there be free will unless a choice is available? The Lord had to create a universe in which darkness exists.
What is science? The word is used to refer to beneficial technology like the iPhone but also to a pseudoscientific narrative of godless existence. The word, as used, refers to a mixture of truth and error.
The prevailing belief among most people, whether they think it's true or not, is that God created a perfect world which became corrupted through human disobedience. We can see a statement like this in Genesis 1:31.
Creation was corrupted before Adam and Eve sinned in the garden of Eden. It was created in a corrupted state in order to manifest free will. We can prove it using a process we call deductive questioning.