People had gotten really bad. God was still wanting to rescue people, but people had forgotten about God. They forgot he loves them and began to chase after their own desires. As a result, humanity had strayed far away from God and was very wicked.
God judged sin on the world at that time with a flood. The whole world was destroyed except for one man and His family. But because Noah loved God, God continued His love story to humanity.
It was by faith that Noah built a large boat to save his family from the flood. He obeyed God, who warned him about things that had never happened before. By his faith Noah condemned the rest of the world, and he received the righteousness that comes by faith. – Hebrews 11:7 (NLT)
God provided a way of escape from the flood in the ark. The ark provided salvation from the flood and was a picture of what God would one day do through Jesus.
Just as Jesus provided us with salvation from our sin, the ark provided a door of salvation from the destruction of the world at that time.
Once again, god was making a plan to rescue mankind one day. By destroying the world that was at that time, He was able to save a remnant of people so that one day the Messiah would come and save the whole world.