From Pope St. John Paul II’s encyclical Veritatis Splendor (1993):
The statement that “There is only one who is good” thus brings us back to the “first tablet” of the commandments, which calls us to acknowledge God as the one Lord of all and to worship him alone for his infinite holiness (cf. Ex 20:2-11). The good is belonging to God, obeying him, walking humbly with him in doing justice and in loving kindness (cf. Mic 6:8). Acknowledging the Lord as God is the very core, the heart of the Law, from which the particular precepts flow and towards which they are ordered. In the morality of the commandments the fact that the people of Israel belongs to the Lord is made evident, because God alone is the One who is good. Such is the witness of Sacred Scripture, imbued in every one of its pages with a lively perception of God’s absolute holiness: “Holy, holy, holy is the Lord of hosts” (Is 6:3).
But if God alone is the Good, no human effort, not even the most rigorous observance of the commandments, succeeds in “fulfilling” the Law, that is, acknowledging the Lord as God and rendering him the worship due to him alone (cf. Mt 4:10). This “fulfilment” can come only from a gift of God: the offer of a share in the divine Goodness revealed and communicated in Jesus, the one whom the rich young man addresses with the words “Good Teacher” (Mk 10:17; Lk 18:18). What the young man now perhaps only dimly perceives will in the end be fully revealed by Jesus himself in the invitation: “Come, follow me” (Mt 19:21).
— Veritatis Splendor 11