We had a neighbour who bought an old boat, parked it in his driveway and set about repairing it to make it sea-worthy again. It took him a long time. Indeed, the boat was parked in view of every passer-by, and because we don't live very near the sea sometimes people would say jokingly, "Does he know something we don't know? Is there a flood coming?"
I'm sure people must have said the same thing about Noah when he started to build a boat. It took him a long time (you can read the whole story in Genesis 6-8). Noah did know something that the people of his day did not want to listen to or to take seriously, though Noah preached to them. We read that "the Lord saw that the wickedness of man was great in the earth" (Genesis 6:5), and God made up his mind to come with a terrible judgement upon them, and to do it by means of an enormous flood.
Noah was a godly man who "walked with God," so God warned Noah about the coming flood and how God wanted to save Noah his family and many of the animals. So that's why he commanded him to build a great ship — the ark. And it all worked out as God said. Noah and his family alone were saved along with the animals in the ark while all the unbelieving crowds were lost. God's judgment for sin is a very real, very terrible thing. And God has promised that there will still be a judgment on sin unless people repent and turn to Chris for salvation and then live godly lives.