Genesis 6:5 And God saw that the wickedness of man was great in the earth, and that every imagination of the thoughts of his heart was only evil continually.
6 And it repented the LORD that he had made man on the earth, and it grieved him at his heart.
7 And the LORD said, I will destroy man whom I have created from the face of the earth; both man, and beast, and the creeping thing, and the fowls of the air; for it repenteth me that I have made them.
8 But Noah found grace in the eyes of the LORD.
Like Enoch, Noah also “walked with God”:
Genesis 6:9 … Noah is a righteous man; perfect he hath been among his generations; with God hath Noah walked habitually. —Young’s Literal Translation
So Noah built an ark according to the instructions Yahweh gave him. Rabbinical texts say that Noah kept preaching at his neighbors, which annoyed them, and that Yahweh had to post guards — lions and other wild animals — in order to protect them. Yahweh, or his angels, were reportedly the ones to provide the animals and food for the trip.
Genesis 6:19 And of every living thing of all flesh, two of every sort shalt thou bring into the ark, to keep them alive with thee; they shall be male and female.
20 Of fowls after their kind, and of cattle after their kind, of every creeping thing of the earth after his kind; two of every sort shall come unto thee, to keep them alive.
21 And take thou unto thee of all food that is eaten, and thou shalt gather it to thee; and it shall be for food for thee, and for them.
But apparently it was a little more complicated than just two of every living thing of all flesh:
Genesis 7:2 Of every clean beast thou shalt take to thee by sevens, the male and his female: and of beasts that are not clean by two, the male and his female.
3 Of fowls also of the air by sevens, the male and the female; to keep seed alive upon the face of all the earth.
Genesis 7:2 [O]f all the clean beasts thou dost take to thee seven pairs, a male and its female; and of the beasts which are not clean two, a male and its female;
3 also, of fowl of the heavens seven pairs, a male and a female, to keep alive seed on the face of all the earth…. —Young’s Literal Translation
But finally Noah (who was 600 years old) and his sons and their wives and all their beasts went onto the boat, having been given a week’s warning by Yahweh as to when the rain would start, and “the LORD shut him in.”
Genesis 7:13 In the selfsame day entered Noah, and Shem, and Ham, and Japheth, the sons of Noah, and Noah’s wife, and the three wives of his sons with them, into the ark;
14 They, and every beast after his kind, and all the cattle after their kind, and every creeping thing that creepeth upon the earth after his kind, and every fowl after his kind, every bird of every sort.
15 And they went in unto Noah into the ark, two and two of all flesh, wherein is the breath of life.
16 And they that went in, went in male and female of all flesh, as God had commanded him: and the Lord shut him in.
It then rained for 40 days and 40 nights, and the Earth stayed flooded for another 150 days.
When Noah was able to send out a dove who first returned with an olive leaf and then didn’t come back at all, he knew there was dry land to be found. Noah “removed the covering of the ark, and looked, and, behold, the face of the ground was dry.”