chéng​qián​bì​hòu

to learn from past mistakes