In response to the Torah’s directive that we cleave to God, our sages ask how that is possible in light of the fact that “the Lord your God is a consuming fire” (Deuteronomy 4:24).
They respond by observing that we cleave to God when we follow in His ways: just as he clothes the naked, so must we clothe the naked; just as He is compassionate, gracious, and charitable to all beings, so must we be charitable as well.
When we do as God does, we are similar to Him; and when we are similar to God, we cleave to Him (Sotah 14a).
—Rabbi Adin Steinsaltz