First Post, I’m really shocked you didn’t even do the basics before you posted.
1. Read it it modern English. KJV is just hopeless to make anything out of. I will never understand why anyone uses it.
2. Read it context. It is not hard. Well, modern versions are put into paragraphs, which makes it easier to get the main idea. None of this stupid line by line King J stuff.
So put it together, and you get:
“15 During the days of my fleeting life I have seen both of these things:
Sometimes a righteous person dies prematurely in spite of his righteousness,
and sometimes a wicked person lives long in spite of his evil deeds.
16 So do not be excessively righteous or excessively wise;
otherwise you might be disappointed.
17 Do not be excessively wicked and do not be a fool;
otherwise you might die before your time.
18 It is best to take hold of one warning without letting go of the other warning;
for the one who fears God will follow both warnings.” Ecc. 7:15-18
In other words, don’t do things to excess or extremes on either side of this warning.