Not all relationships that don't work out were a complete waste of time. That's how it may appear when looking backwards, based on knowing how things turned out. Is an eight-year relationship that ended in a breakup a failure? How about a 20 year or 50-year marriage that ends in divorce? Just because something ends doesn't automatically mean the whole relationship was a failure. Like an old vehicle that eventually can no longer be usefully repaired after years of transporting you from A to B doesn't mean the car was useless the whole time you had it once it's become irreparable.
Consider also the impact of the feelings of resentment and victimhood in looking at the whole period as a waste of time. Does it make you feel good? Probably (definitely) not. With the notable and obvious exception of relationships that included ANY kind of abuse (which is NEVER acceptable), it may be more helpful to look back at the silver linings, the learnings, the good things that may have come from the relationship. Not exclusively, but as a balance of looking at both the good and bad aspects of the relationship holistically. Today a zoomed-out focus can inform you going forward about what you want as well as what you don't want. It gives you insight.