Good and upright [is] the Lord
He is essentially, originally, and independently good of himself in his own nature, and he is providentially good to all his creatures; and he is in a way of special grace and mercy good to his own people: and he is "upright", just in himself, righteous in all his ways and works, and faithful in all his promises; and the consideration of these excellent perfections of his encouraged the psalmist to entertain an holy confidence, that his petitions, respecting instruction and guidance in the ways of the Lord, ( Psalms 25:4 Psalms 25:5 ) ; would be heard and answered, notwithstanding his sins and transgressions;
therefore will he teach sinners in the way;
such who are in sinful ways, he will teach them by his word and Spirit the evil of their ways, and bring them out of them, and to repentance for them; and he will teach them his own ways, both the ways and methods of his grace, in saving sinners by Christ, and the paths of faith and duty in which he would have them walk; see ( Psalms 51:13 ) .