You can put your heart and soul into something for years, towards healing, evolving, learning, growing, forgiving and forgetting, or doing whatever you feel that you need to do to overcome the challenges that life throws at us. It can hurt to have invested so much time and effort towards something, only to have not achieved the end result that you wanted, but this doesn't mean that you've failed. The fact is, you've grown as a person, you've expanded, and you've become a far better person than you were before. Not one single moment invested in yourself towards becoming a better person, and towards becoming the highest and most self-realized version of yourself that you can be is ever wasted. All of your efforts might not bear fruit in the intended area, but they will in others, and rest assured that the Universe will see to that. You personally will benefit from being a better person every single day, as will all others in your life, and the lives of those that you touch. Your efforts will bear fruit in many other ways. No effort is ever wasted.
No effort is ever wasted. Repeat this to yourself often.