At the end, the Book of Qoheleth offers a short synthesis of his thought, while meditating on the different times of life.
He has a vivid, yet melancholic description of old age and death.
His advice, anyway, is to have the thought of God always present, because the spirit of men will return to Him and He will judge every action.
The thought of God gives balance and meaning and hope to human life.