Live an obedient life
God is a God who keeps promises, and if we want to earn the benefits of the blessings that He has reserved for us, we must scrutinize His word to know what those promises are.
God promises long life to those who live under his divine instructions.
In Proverbs 3-1.2 it says: My son, do not forget my law and your heart keep my commandments, because the length of days and years of life and peace will increase you.
I think the only reason why we do not accept this teaching is because it seems too simple, too anti-ethical for our current way of understanding science and medicine.
But if we believe that God's promises are true, we must accept that, focusing on God's word, His Law, and His commandments, will not only lengthen our lives but will also add peace to our day.