Vayikra / Leviticus 18:30
וּשְׁמַרְתֶּם אֶת־מִשְׁמַרְתִּי לְבִלְתִּי עֲשׂוֹת מֵחֻקּוֹת הַתּוֹעֵבֹת אֲשֶׁר נַעֲשׂוּ לִפְנֵיכֶם וְלֹא תִטַּמְּאוּ בָּהֶם אֲנִי יְהוָה אֱלֹהֵיכֶם׃
So you shall keep My charge, not to do any of the abominable customs that were done before you, and not make yourselves impure with them. I am the Eternal your Almighty."
Pshat פְּשָׁט
Keep My charge
Rashi: "you shall keep My charge" is a warning to the court to watch over this. "And do not make yourselves impure with them. I am the Eternal your Almighty": if you make yourselves impure, you become unfit for Me, and what benefit do I have from you? Sforno: keep also the commandments I gave as a guard and a fence, such as the laws of forbidden food and of impurity, and so you will not become impure.
How Rashi and Sforno explain it
Remez רֶמֶז
A charge for the charge
Malbim: in the words "keep My charge" a noun of the same root stands beside the verb, and this calls for interpretation: keep the charge too, that is, the fences around the bans, such as the secondary bans on intimacy. That is why it is said to be a warning to the court: the court sets the fences. And "do not make yourselves impure with them", with the letter bet (ב), speaks of impurity of the soul, not of the body. Bartenura: "a charge around My charge" means the sages' fences, such as the secondary bans on intimacy and the sages' Shabbat bans.
How Malbim and Bartenura explain it
Drash דְּרָשׁ
A fence for the Torah
The Mishnah: Moshe (Moses) received the Torah at Sinai, and it was handed on down to the Men of the Great Assembly, who said: "Make a fence for the Torah." Alshich: if you set fences around My bans, then even when you err you will break only the fence, not the ban itself. So the Eternal promises: "and you shall not become impure with them."
How Pirkei Avot and Torat Moshe explain it
Sod סוֹד
The charge the Eternal keeps
Yismach Moshe: "keep My charge" is also read as "what I keep". The Blessed One keeps Israel from the sword of Esav (Esau) through the sign of the covenant, circumcision, and forbidden unions spoil this sign. That is why the verse stands at the end of the section on them. Midrash Lekach Tov: the Eternal opened the section on forbidden unions with His Name and closed it with His Name: "I am the Eternal your Almighty."
How Yismach Moshe and Midrash Lekach Tov explain it