https://www.biblegateway.com/passage/?search=Genesis%206&version=KJV
The Lord was grieved in His heart by wickedness of men and their hearts were only evil. He decided to destory everything corrupt and every evil thing on the face of the earth.
Verse 8 But Noah found grace in the eyes of the Lord. God instructed Noah to build the ark to take with him hhis wife and sons and their wives. Then, take 2 of every living thing of flesh and keep them alive they shall be male and female.
Verse 18 is the first covenant established by God and Noah and his family.
Using Barnes’ Notes from the Bible Hub below.
The covenant with Noah. Here is the first appearance of a covenant between God and man on the face of Scripture. A covenant is a solemn compact, tacit or express, between two parties, in which each is bound to perform his part. Hence, a covenant implies the moral faculty; and wherever the moral faculty exists, there must needs be a covenant. Consequently, between God and man there was of necessity a covenant from the very beginning, though the name do not appear. At first it was a covenant of works, in regard to man; but now that works have failed, it can only be a covenant of grace to the penitent sinner. “My covenant.” The word “my” points to its original establishment with Adam. My primeval covenant, which I am resolved not to abandon. “Will I establish.” Though Adam has failed, yet will I find means of maintaining my covenant of life with the seed of the woman. “With thee.” Though all flesh be to perish through breach of my covenant, yet will I uphold it with thee. “Go into the ark.” This is the means of safety. Some may say in their hearts, this is a clumsy way to save Noah. But if he is to be saved, there must be some way. And it is not a sign of wisdom to prescribe the way to the All-wise. Rather let us reflect that the erection of this ark was a daily warning to a wicked race, a deepening lesson of reliance on God to Noah and his household, and a most salutary occupation for the progenitors of the future race of mankind. “And thy sons, etc.” Noah’s household share in the covenant.
This is the first covenant between God and Man. Covenant is a Promise.