Mądry Polak po szkodzie.
“A Pole is wise after the damage is done.”
People often only understand what they should have done after they have already suffered the consequences of not doing it.
Source: Traditional Polish proverb, public-domain oral tradition