Passage
Surely there is not a righteous man upon earth, that doeth good and sinneth not.
Surely there is not a righteous man upon earth, that doeth good and sinneth not.
Ecclesiastes 7:18 It is good that thou shouldest take hold of this; yea, also from that withdraw not thy hand: for he that feareth God cometh forth from them all.
Ecclesiastes 7:19 Wisdom strengtheneth the wise more than ten mighty [men] that are in a city.
Ecclesiastes 7:20 Surely there is not a righteous man upon earth, that doeth good and sinneth not.
Ecclesiastes 7:21 Also give not heed unto all words that are spoken, lest thou hear thy servant curse thee.
Ecclesiastes 7:22 For also thine own heart knoweth that oftentimes thou thyself likewise hast cursed others.
The verse centers on "surely", "righteous", "upon", "earth", "doeth", "good", and "sinneth". It is saying that the verse draws attention to "surely" and "righteous", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 19's "Wisdom strengtheneth the wise more than ten..." into verse 21's "Also give not heed unto all words...", so "surely" and "righteous" belong inside that flow. In Ecclesiastes context, the local focus is covenant, worship, and faithfulness.
A plain takeaway is to answer the verse's own emphasis on "surely" and "righteous" with trust shaped by these words, not by a vague optimism outside the passage.