You are thinking of Genesis 6:1,2 Now it came to pass, when men began to multiply on the face of the earth, and daughters were born to them, that the sons of God saw the daughters of men, that they were beautiful; and they took wives for themselves of all whom they chose.
The phrase, “Sons of God” first appears in Genesis 6 and it refers to God's people. If you look at Genesis 4, you will see that in verse 26 "men began to call upon the name of the LORD." The alternative translation in the margin notes that the Hebrew actually says that they called themselves "by the name of the LORD" i.e. "sons of God."
There was a sharp demarcation between the two communities, the "sons of God" and the "sons of men." It is NOT speaking about angels. In fact, our Lord Jesus Christ specifically says that angels do not marry. See Luke 20:34-36. Note that in this passage he says that in the resurrection we shall become like the angels and he gives two ways in which we will be like them - although I'm sure there are many more. He says being like the angels we will not enter into marriage and we will be immortal. If we are immortal, we cannot sin for "the wages of sin is death". That means that the "sons of God" in Genesis 6:1,2 cannot be angels because they took wives and were sinful.
There is such a separation between the "children of God" and the "children of men" today - see 2 Corinthians 6:14-18. Note that the phrase "sons of God" in the New Testament always refers to believers. See John 1:12; Romans 8:14; Philippians 2:15; 1 John 3:1,2.
In Genesis 6, the community of the faithful joined themselves to the community of the flesh , a community characterized by greed, idolatry, immorality, and violence. The community of faith sank to the lowest common denominator and was corrupted. Only one family remained faithful - Noah's family. We know what happened to those who joined themselves to the world and left the family of faith. They perished. The door to the ark of safety was closed to them.
What of us? We do well to heed the example of Noah and the words of the Lord Jesus when he said Matthew 24:26,27 - "And as it was in the days of Noah, so shall it be also in the days of the Son of man. They did eat, they drank, they married wives, they were given in marriage, until the day that Noah entered into the ark, and the flood came, and destroyed them all." Let's be sure to be among "the sons of God" in the ark of safety when our Lord returns!
I hope you have found this helpful.