Good character is more than smiling. It includes gentle language, keeping promises, fairness in disagreement, respect for those with less power, and apologizing and correcting conduct after mistakes. Polite words do not excuse deception, and protecting someone’s rights need not involve humiliation.
Example 1: Correct a classmate privately, respectfully, and constructively.
Example 2: Speak courteously to a customer while also disclosing a product defect honestly.
In خُلُقٍ حَسَنٍ, حَسَنٍ is an adjective describing خُلُقٍ. Both take genitive endings because of the preceding preposition بِ.