Genesis 6:2 That the sons of God saw the daughters of men that they were fair; and they took them wives of all which they chose.
We have some assistance in the New Testament which enables us to understand this.
The sons of God cannot be a reference to angels, because as Jesus tells us - angels do not marry – They do not reproduce.
Matthew 22:30 For in the resurrection they neither marry, nor are given in marriage, but are as the angels of God in heaven.
Mark 12:25 For when they shall rise from the dead, they neither marry, nor are given in marriage; but are as the angels which are in heaven.
And Paul writes to the Romans:
Romans 8:14 For as many as are led by the Spirit of God, they are the sons of God.
If we ask who were the first to be led by the spirit of God, we are told in Genesis 4:
Genesis 4:25 And Adam knew his wife again; and she bare a son, and called his name Seth: For God, said she, hath appointed me another seed instead of Abel, whom Cain slew. 26 And to Seth, to him also there was born a son; and he called his name Enos: then began men to call upon the name of the LORD.
Seth and his offspring began to call upon the name of God.
We might reasonably suppose from this that Seth and his offspring calling on the name of God means that they were the first to be led by the Spirit of God.
Thus, ‘the sons of God’ refers to the male descendants of Seth (and others who 'called upon the name of the Lord) who made the mistake of marrying daughters of men (Cain and other descendants of Adam) who did not call upon God.
The children produced were egotistical men of renown.
I hope you find this helpful.