If the law wasn't given to Moses until the Hebrews were in the wilderness at Mount Sinai; how did Noah know the difference between clean and unclean animals, how did Abraham know to tithe and how did the Hebrews in Egypt know to keep the Sabbath?
Moral laws are written on our hearts. We are created in God's image.
Almost everyone is every society knows certain things are wrong. They've never heard of the Bible or the 10 commandments, but yet somehow... they know killing people is wrong, lying is wrong, stealing is wrong.
Sexual sins and idol worship aren't usually considered wrong. by non-Christians.
How did Noah know which animals were clean before the Levitical law was given? Is everything God told Noah recorded in the Bible? Chances are God simply told him.
And all the Levitucal laws were given to set the Children of Israel apart from the rest of the people groups?
Even the Gentiles had to follow these laws under Judaism. (Over 20 verses in the OT say this, and over a dozen in the NT also)
In fact the very first time the law was read in the promised land, Gentiles were there.
Josh 8:30; Then Joshua built an altar to the Lord, the God of Israel, on Mount Ebal,
Josh 8:31; just as Moses the servant of the Lord had commanded the sons of Israel, as it is written in the Book of the Law of Moses, an altar of uncut stones on which no one had wielded an iron
tool; and they offered burnt offerings on it to the Lord, and sacrificed peace offerings.
Josh 8:32; And he wrote there on the stones
a copy of the Law of Moses, which he had written, in the presence of the sons of Israel.
Josh 8:33; And all Israel with their elders, officers, and their judges were standing on both sides of the ark before the Levitical priests who carried the ark of the covenant of the Lord,
the stranger as well as the native.
Half of them stood in front of Mount Gerizim, and half of them in front of Mount Ebal, just as Moses the servant of the Lord had commanded at
first to bless the people of Israel.
Josh 8:34; Then afterward he read all the words of the Law, the blessing and the curse, according to everything that is written in the Book of the Law.
Josh 8:35; There was not a word of
all that Moses had commanded which Joshua did not read before all the assembly of Israel with the women, the little ones, and
the strangers who were living among them.
Verse 33 says the stranger as well as the native. There were no native Jews in Canaan, The whole book of Joshua is about Joshua and Gideon driving out the Canaanites so the Jews can take the promised land.
So who were these strangers? Also verse 35 says "the strangers living among them". They were all strangers to Canaan, so who were these people, they would have been Gentiles such as Rahab (who was a Canaanite).
When the covenant of circumcision was given to Abraham, he circumcised Ishmael before he circumcised Isaac, even though Ishmael was not a Jew.
Isaac and Jacob were really the first Jews. Yes Abraham was their forefather, but he was also Ishmael's forefather was well.
The 10 commandments always applied to the Gentiles, and all but one of them are repeated in Paul's books to the Gentiles in the New Testament.
[NLT]
Rom 2:12;
When the Gentiles sin, they will be destroyed, even though they never had God’s written law. And the Jews, who do have God’s law, will be judged by that law when they fail to obey it.
Rom 2:13; For merely listening to the law doesn’t make us right with God.
It is obeying the law that makes us right in his sight.
Rom 2:14;
Even Gentiles, who do not have God’s written law, show that they know his law when they instinctively obey it, even without having heard it.
Rom 2:15; They demonstrate that God’s law is written in their hearts, for their own conscience and thoughts either accuse them or tell them they are doing right
1Cor 7:19; Circumcision is nothing, and uncircumcision is nothing, but
what matters is the keeping of the commandments of God.
One example - the only one I have memorized off the top of my head...
Eph 6:1; Children, obey your parents in the Lord, for this is right.
Eph 6:2; Honor your father and mother (which is the first commandment with a promise),
Eph 6:3; so that it may be well with you, and that you may live long on the earth.
But I can find the others if necessary.