Tractate Sota 14a as translated by Sefaria.org
And Rabbi Ḥama, son of Rabbi Ḥanina, says: For what reason was Moses buried near Beth Peor? In order to atone for the incident that transpired at Beth Peor (Numbers, chapter 25). And Rabbi Ḥama, son of Rabbi Ḥanina, says: What is the meaning of that which is written: “After the Lord your God shall you walk, and Him shall you fear, and His commandments shall you keep, and unto His voice shall you hearken, and Him shall you serve, and unto Him shall you cleave” (Deuteronomy 13:5)? But is it actually possible for a person to follow the Divine Presence? But hasn’t it already been stated: “For the Lord your God is a devouring fire, a jealous God” (Deuteronomy 4:24), and one cannot approach fire. He explains: Rather, the meaning is that one should follow the attributes of the Holy One, Blessed be He. He provides several examples. Just as He clothes the naked, as it is written: “And the Lord God made for Adam and for his wife garments of skin, and clothed them” (Genesis 3:21), so too, should you clothe the naked. Just as the Holy One, Blessed be He, visits the sick, as it is written with regard to God’s appearing to Abraham following his circumcision: “And the Lord appeared unto him by the terebinths of Mamre” (Genesis 18:1), so too, should you visit the sick. Just as the Holy One, Blessed be He, consoles mourners, as it is written: “And it came to pass after the death of Abraham, that God blessed Isaac his son” (Genesis 25:11), so too, should you console mourners. Just as the Holy One, Blessed be He, buried the dead, as it is written: “And he was buried in the valley in the land of Moab” (Deuteronomy 34:6), so too, should you bury the dead.