After the splitting of the sea, the first place the Jewish nation camped along its journey to Har Sinai to receive the Torah was a place called Marah. The Bnei Yisrael were given three commandments while they camped at Marah, one of them being the foundation of Shabbos.
Rebbe Chaim of Chernovitz presents a beautiful analogy to explain why Klal Yisroel had to experience a taste of the sweetness of Shabbos before being presented with the rest of the Torah’s commandments.
(CREDITS: Rabbi Yaakov Klein https://lpitorah.org/eilecha-weekly/)
On one hand, the Torah says you shouldn't make a Neder. On the other hand, Yaakov made a נדר with Hashem before he went...