Hello فرحة عمر
your translation is not too bad, however you used the literal wrong sense of the word هرم
here it means to grow old, reach an old age or to become a decrepit which I prefer because it shows the quality or condition of being weakened
here is my version of translation and I hope it helps you :
(وهذه الترجمه)
Take advantage of five matters before (other) five matters: your youth before your decrepitude, your health before your illness, your wealth before your poverty, your leisure before your preoccupation and your life before your death”
Good luck :)