If Jesus is God, then why in Mark 10:18 and Luke 18:19 did he say “Why do you call me good? No one is good except God alone.”?

There really is no one that is good besides God alone. Not only can we look at the Bible to see this, but we can look around us. The world is full of people who continuously perform evil deeds in the sight of God. The only person who has ever been innocent and not in need of forgiveness is Jesus Christ. When the man referred to Jesus as ‘good teacher,’ Jesus’ reply did not deny his divinity, but affirmed it.