The earth also was corrupt before God, and the earth was filled with violence. So God looked upon the earth, and indeed it was corrupt; for all flesh had corrupted their way on the earth.
And God said to Noah, “The end of all flesh has come before Me, for the earth is filled with violence through them; and behold, I will destroy them with the earth. Make yourself an ark of gopherwood; make rooms in the ark, and cover it inside and outside with pitch. And this is how you shall make it: The length of the ark shall be three hundred cubits, its width fifty cubits, and its height thirty cubits. You shall make a window for the ark, and you shall finish it to a cubit from above; and set the door of the ark in its side. You shall make it with lower, second, and third decks. And behold, I Myself am bringing floodwaters on the earth, to destroy from under heaven all flesh in which is the breath of life; everything that is on the earth shall die. But I will establish My covenant with you; and you shall go into the ark—you, your sons, your wife, and your sons’ wives with you. And of every living thing of all flesh you shall bring two of every sort into the ark, to keep them alive with you; they shall be male and female. Of the birds after their kind, of animals after their kind, and of every creeping thing of the earth after its kind, two of every kind will come to you to keep them alive. And you shall take for yourself of all food that is eaten, and you shall gather it to yourself; and it shall be food for you and for them.” (Genesis 6:11-21)
Despite God’s dismay over a creation that no longer seemed good, but only wicked and violent, God found a bright spot in Noah. Noah was “righteous,” “walked faithfully with God” and “found favor in the eyes of the Lord.” (Genesis 6:9) “To find favor” is a Hebrew idiom meaning that God “liked” Noah. He was righteous, but not because he always did the right thing, or because he always performed the right sacrifices. People before Jesus were not made righteous because of their good works. They became righteous the same way that people do today: by grace, through faith. No one has ever been saved by following the law or sacrificing animals (Romans 3:20, Galatians 3:11, Hebrews 10:4).
God gave Noah detailed plans on how to rescue himself, his family, and the animals. He did not hold back from Noah the reason the disaster was coming. And he gave Noah plenty of time to prepare.
In the midst of the judgment against the world, God offered mercy to one man, his family, and pairs of clean and unclean animals. God preserved a future for humanity and the life of the planet.