Leviticus 19:2

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

Speak to the entire congregation of the children of Israel and say to them, “You shall be holy because I, Hashem your G-d, am holy.”

The Baal HaTurim points out that the previous parsha ends by telling us to guard ourselves from various abominations. He explains this juxtaposition as follows: if we guard ourselves from sin, then we will become holy.