ASV notes on Genesis 6:9-10 and 11-12
Noah and his family were no better than the rest of the sinful people around him, like you if you are borne again and walk with Jesus every day, you are not better than murders and thieves around you. The righteousness of Noah was not in Noah, but in the fact that he walked with God every day. You can say that he walked with God, but not every day. Yes every day, God is walking; if you are not walking with Him every day you are left behind.
Noah was preaching the word of God and that made him righteous in the eyes of the LORD, God is not demanding perfection, He looks to your heart and notice your intention of your actions. God influenced Noah with His goodness and Noah led it on to his family.
Now the population on earth was so corrupt and debased in moral and violence, the world was rotten and it was stinking and decomposing, there were no rescue. Like when you forgot some meat in the fridge and when you found it, the meat was useless and stank and polluted everything in the fridge.
Only with God you can resist the development of sin in your life, there is no resistance power in your flesh, or in yourself. Against the sin in us, exploited by the devil, the master of seduction you have no chance.