Is very unfortunate going through the pains you are having now, is part of life experience and you have learned your lesson in a sad way but however like every other persons has advised you, don't dwell on the past because it will keep bringing the bad memories and believe me it can pull you down from Progressing or consume you so just focus on the future because more bigger things is waiting for you and besides 40 years is too small for someone to give up because there are still many years in your life to achieve more good things so keep pushing and forget about the past.
I think all lessons in life will always be learned with some difficulty and it's normal and fine, and once we overcome it, we will realize that it is actually very rewarding. We are going to get proud of ourselves. Dwelling in the past is like regretting for a scenario that didn't happened but as they say, everything happens for a reason. And maybe we won't actually be happy and regret it even more once it happened.
In life, there's always obstacles along the way, though yeah that I think it's possible for us to lessen them by doing the right thing. Focusing in the past is useless because we still can't change it anymore but indeed that we can make a better memory than it, as long as we focus on the present, learn from our mistakes, or do better decisions this time. 40 years is not small and we don't know our lifespan. Even if we care for our health, life is still unpredictable but let's only pray and think positive at all times.