Devarim11:22

כִּי אִם־שָׁמֹר תִּשְׁמְרוּן אֶת־כָּל־הַמִּצְוָה הַזֹּאת אֲשֶׁר אָנֹכִי מְצַוֶּה אֶתְכֶם לַעֲשֹׂתָהּ לְאַהֲבָה אֶת־יְהוָה אֱלֹהֵיכֶם לָלֶכֶת בְּכָל־דְּרָכָיו וּלְדָבְקָה־בוֹ׃

For if you diligently keep all this commandment which I command you to do, to love the Eternal your Almighty, to walk in all His ways, and to cleave to Him,

Devarim 11:22

כִּי אִם־שָׁמֹר תִּשְׁמְרוּן

Devarim / Deuteronomy 11:22

כִּי אִם־שָׁמֹר תִּשְׁמְרוּן אֶת־כָּל־הַמִּצְוָה הַזֹּאת אֲשֶׁר אָנֹכִי מְצַוֶּה אֶתְכֶם לַעֲשֹׂתָהּ לְאַהֲבָה אֶת־יְהוָה אֱלֹהֵיכֶם לָלֶכֶת בְּכָל־דְּרָכָיו וּלְדָבְקָה־בוֹ׃

For if you diligently keep all this commandment which I command you to do, to love the Eternal your Almighty, to walk in all His ways, and to cleave to Him,

Pshat פְּשָׁט

How to cleave to a fire

Rashi: to walk in His ways means to be like Him: He is merciful, so you be merciful, He does kindness, so you do kindness. One cannot cleave to the One who is "a consuming fire", so cleave to the sages and their students, and it will count for you as if you cleaved to Him. Sforno: His ways are righteousness and justice, and to cleave to Him means to direct all your deeds to doing His will.

How Rashi and Sforno explain it

Remez רֶמֶז

Keeping and being kept

Rashi: the doubled verb "keeping, you shall keep" warns of much keeping: guard your learning so that it is not forgotten. Rabbeinu Bahya brings a midrash: the same letters read "you will be kept". One who keeps the commandments of the Torah is kept from every enemy. So too in the passage "And it shall be, if you listen": one who listens to the Torah will be listened to.

How Rashi and Rabbeinu Bahya explain it

Drash דְּרָשׁ

A coin and a glass vessel

Midrash Lekach Tov: learning must be guarded like a coin: Torah is hard to acquire and easy to lose, like a glass vessel. One who learns little by little, one halachah a day, becomes rich in time, and one who learns and forgets is like a woman who gives birth and buries. To cleave to the Eternal means to cleave to the sages and their students. Sefat Emet: every blessing needs guarding. Through keeping the commandments the person himself is kept, and he has the strength to receive the blessings.

How Midrash Lekach Tov and Sefat Emet explain it

Sod סוֹד

A thought that does not leave

Ibn Ezra: to cleave to Him is "at the end", and it is a great secret. Ramban: cleaving means always remembering the Eternal and His love, so that the thought does not part from Him. You speak with people with your mouth, while your heart is before the Eternal. For people of this level the soul is bound in the bundle of life even in their lifetime, and they themselves are a dwelling for the Presence of the Creator. Sha'arei Kedusha: the main thing is to set the Eternal before one's eyes and cleave to Him in thought, without a moment's break.

How Ibn Ezra, Ramban, and Sha'arei Kedusha explain it