The Buddha explains that when you see someone faring badly, you should conclude that you too have experienced the same over the long span of time of cyclic existence.

Duggata sutta - Faring Badly

At one time, the Blessed One was dwelling in Sāvatthi. There, the Blessed One addressed the bhikkhus: "Bhikkhus."

"Venerable sir," those bhikkhus replied to the Blessed One. The Blessed One said this:

"Bhikkhus, this cyclic existence is without a discoverable beginning. A first point is not discerned for beings who, obstructed by ignorance and fettered by craving, run on and wander in this cycle of existence. Whenever you see anyone faring badly, in misfortune, you should conclude: 'We too have experienced the same, over this long span of time.'

For what reason? Bhikkhus, this cyclic existence is without a discoverable beginning. A first point is not discerned for beings who, obstructed by ignorance and fettered by craving, run on and wander in this cycle of existence. For such a long time, bhikkhus, you have experienced suffering, agony, and calamity, the cemetery has been filled up with your bones. Therefore, bhikkhus, it is enough to become disenchanted, to become detached and to become free from all conditions."