Sometime after the creation of Adam and Eve on the sixth day of creation, see Genesis 1:26-31, they rebelled against God by eating the fruit of the tree of the knowledge of good and evil.
By doing so they brought sin into the world and upon all of humanity. The details of this are in Genesis 3:1-24.
“Behold, God is exalted by His power; who teaches like Him? Who has assigned Him His way, or who has said, ‘You have done wrong’? Remember to magnify His work, of which men have sung. Everyone has seen it; man looks on it from afar. Behold, God is great, and we do not know Him; nor can the number of His years be discovered. For He draws up drops of water, which distill as rain from the mist, which the clouds drop down and pour abundantly on man. Indeed, can anyone understand the spreading of clouds, the thunder from His canopy?” Job 36:22-29.
“He [the Lord] loves righteousness and justice; the earth is full of the goodness of the Lord. By the word of the Lord the heavens were made, and all the host of them by the breath of His mouth. He gathers the waters of the sea together as a heap; He lays up the deep in storehouses. Let all the earth fear the Lord; let all the inhabitants of the world stand in awe of Him. For He spoke, and it was done; He commanded, and it stood fast.” Psalm 33:5-9.