Matthew 19:17

17 “Why do you ask me about what is good?” Jesus replied. “There is only One who is good. If you want to enter life, keep the commandments.”

Read Matthew 19:17 Using Other Translations

And he said unto him,Why callest thou me good? there is none good but one, that is, God: but if thou wilt enter into life, keep the commandments.
And he said to him, "Why do you ask me about what is good? There is only one who is good. If you would enter life, keep the commandments."
“Why ask me about what is good?” Jesus replied. “There is only One who is good. But to answer your question—if you want to receive eternal life, keep the commandments.”