What do we learn from the juxtaposition of these 2 seemingly unrelated laws?
אִ֣ישׁ אִמּ֤וֹ וְאָבִיו֙ תִּירָ֔אוּ וְאֶת־שַׁבְּתֹתַ֖י תִּשְׁמֹ֑רוּ אֲנִ֖י ה אֱ-לֹהֵיכֶֽם׃
You shall each revere his mother and his father, and keep My sabbaths: I the LORD am your God.
From the juxtaposition of these 2 commandments, the Sages learn that while one must honor one’s parents, it can’t be at the expense of transgressing any Torah commandment.
As well as from the juxtaposition of the mitzvah of respecting one’s parents and keeping the Shabbath, the sages learn that one who respects his parents will have Divine assistance to ensure that he does not accidentally violate Shabbat.