The Ten Commandments are found first in the book of Exodus, then in Deuteronomy. In Exodus 20:1-17, and in Deuteronomy 5:4-21.
The Ten Commandments are God’s law for all men in all times. It was not a new teaching at that time, however this event is a kind of ratification of the law in the covenant between God and the Israelites, whom He has just rescued out of Egypt.