If you left the cooked corn out for more than two hours (the danger zone for bacteria), do not store it. Toss it. I know, it hurts. But corn is a warm-weather vegetable, and bacteria love it more than you do. Botulism is not a flavor note you want in your leftovers. Throw it away with a tiny eulogy: “Goodbye, sweet kernel. You were too good for this world.”
But if it’s been less than two hours, you’re fine. Just don’t put it in the fridge warm—that raises the temperature of the whole fridge and makes your milk sad. Cool it down first. Use the ice bath. You’ve got this.