The humor in the episode comes from the fact that Ted views this as a profound, custom bit of wisdom, only for the group to realize he has been using the exact same scripted "useful piece" for every break-up they've had for years.
The phrase "useful piece" from the How I Met Your Mother episode (Season 8, Episode 5) refers to a running gag where Ted uses a specific line to console his friends during their break-ups. [S8E5] The Autumn of Break-Ups
In this episode, the "useful piece" of advice Ted offers to both Barney and Victoria is: The humor in the episode comes from the