The Prophet (صلى الله عليه و سلم) said in the Saheehayn, the best of you are those with the best and most perfect character!
The ulema said that if knowledge without good character was something praiseworthy, then Shaytaan would have been from the best of people.
The one who has no ilm and good character doesn’t damage anyone but himself. However, the one with ilm and poor character damages himself and others!
A dua the Prophet (صلى الله عليه و سلم) would make:
(واهدني لأحسن الأخلاق (صحيح مسلم