This quote means that if the speaker can do something that prevents somebody else from suffering a great emotional pain, then their life will not have been wasted. It is about making a positive difference in someone else’s life and seeing that impact, which gives meaning to one’s own life.