Ecclesiastes 12:13

Amplified Bible (AMP)
When all has been heard, the end of the matter is: fear God [worship Him with awe-filled reverence, knowing that He is almighty God] and keep His commandments, for this applies to every person.

Read Ecclesiastes 12:13 in other translations