"Be close to the villain and stay away from the gentleman" means to be close to the treacherous people who gossip and stay away from the virtuous, knowledgeable and wise people.
This is Zhuge Liang's "Previous Discipline": Being close to virtuous ministers and staying away from villains is why the early Han Dynasty prospered; being close to villains and staying away from virtuous ministers is why the Han Dynasty has declined since then. one of the sentences.
Villain: Usually refers to the antonym of "gentleman" as defined by Confucianism. It mostly refers to people in social life who like to fight openly and secretly, do bad things such as gossiping, sowing dissension, watching from the other side, adding insult to injury, cheating and other bad things, and " The word "noble" goes against the grain.
Gentleman: A talented and virtuous person is called a gentleman if he is strong in his knowledge and gives in to others, and does good deeds without slacking off.