If someone accidentally starts to cook kosher food in a pot that was used to cook non-kosher food, but the pot wasn't used in 24 hours, may the person let the food finish cooking?
It is forbidden to cook in a pot once you know it is non-kosher but, after the fact, one can eat the food. The Shulchan Aruch (YD 122:2) writes (Sefaria's translation with my slight adjustments)
A vessel which is not ben yomo, meaning that the vessel has sat for 24 hours since prohibited substance was cooked in it, this gives a detrimental taste, but even so, the Sages forbade cooking in it initially.
In this specific case, I asked R Binyamin Tabady who said that, once one realizes the pot is non-kosher, one should pour the food in another pot and can eat the food (and need to kasher the original pot). If one did not pour the food in another vessel, after the fact, one can still eat the food.
For a broader discussion of these issues see here (and the conclusion under "Natlap Be-Keilim – In Practice")
Of course, as usual, don't trust anything you read here, and ask your Rav should this happen in real life.