Imam Shafi'i (Rahmatullahi Alaih) narrates:
"Whoever desires that Allah Almighty opens his heart, grants him knowledge, and bestows wisdom upon him, he should choose solitude (spend time alone), eat less, and avoid the company of fools as well as those scholars who possess no sense of justice and manners."
[Manaqib ash-Shafi'i lil-Bayhaqi: 2/172]