To strike while the iron is hot means to act quickly before an opportunity is gone.
In medieval Europe, blacksmiths worked red-hot iron by hand from a forge.
They shaped the heated metal with a hammer before it cooled, so they needed to work quickly, because as the iron cools it becomes brittle and impossible to work with.
If the moment is missed, the metal has to be reheated and the process started over.
Under urgent circumstances, we often say we have to “strike while the iron is hot”.