The main idea/important event in Gn 6:5-22 is the ark that Noah had built. The first thing that happens is that God tells Noah to build an ark telling him how to build it, such as the ark having to have cubits, an opening, decks, and an entrance, so he does. Next God tells him that everyone such as his wife, sons, sons wives, living creatures two of every kind, male and female, and him should all go in the ship. Finally all Noah had to do was provide food for himself and all of the others. Everything that God told Noah to do before the flood was to occur, Noah did.
This is how you should build it: the length of the ark will be hundred cubits, its width fifty cubits, and its height thirty cubits"(Gn 6:15)
"You shall go into the ark, you and your sons, your wife and sons wives with you. Of all living creatures you shall bring two of every kind into he ark, one male and one female to keep them alive with you"(Gn 6:18-19)
"Moreover, you are to provide yourself with all the food that is to be eaten, and store it away, that it may serve as provisions for you and them"(Gn 6:21)
A life lesson we can learn from this passage is to always listen to what God tells you because God always knows what’s best for you and for others.