Moses met with God upon Mount Sinai for forty days and forty nights.
GOD called Moses and Joshua higher upon Mount Sinai where He met with Moses for 40 days and 40 nights, giving Moses Israel's new Law:
12 Then the Lord said to Moses, “Come up to Me on the mountain and be there; and I will give you tablets of stone and the law and commandments I wrote, that you may teach them.” 13 So Moses arose with his assistant Joshua, and they went up to the mountain of God. 14 But he said to the elders, “Wait here for us until we come back to you. Indeed, Aaron and Hur are with you. If any man has a difficulty, let him go to them.” 15 Then Moses and Joshua went up the mountain, and the cloud covered the mountain. 16 Now the glory of God descended on Mount Sinai, and the cloud covered it six days. Then on the seventh day the Lord called to Moses out of the midst of the cloud. 17 The sight of the Lord's glory was like a burning fire on the top of the mountain before the children of Israel. 18 So Moses went into the midst of the cloud and went up the mountain; and he was on the mountain forty days and forty nights.
(Exodus 24:12-18 OSB)
During this time, GOD sustained Moses and Joshua, while GOD delivered the Law of Moses to Moses, along with the first tablets of stone written by GOD's hand, containing the Ten Commandments.