The first one is saying not to respond to a fool according to their own way of talking
The second one is about telling them what’s right so they don’t think THEYRE right
“Do not answer fools according to their folly, or you will be a fool yourself.”
Proverbs 26:4; “Answer fools according to their folly, or they will be wise in their own eyes.”
Proverbs 26:5