How does jumping into a new relationship right after a breakup help someone move on?

and does it actually work out in the long run?