Melt butter in a saucepan, add onions and salt over medium heat. Cook onions until they become translucent.: The sound of butter softening and the scent of the white onions releasing their sweetness are immediate rewards, they tell you the base is developing correctly. Stir gently until the onions become translucent and tender, they should lose their raw edge but not brown; if they begin to brown, the heat is too high and will introduce a toasty flavor that changes the profile. Keep the pan at medium to medium low, and scrape the bottom so no fond forms, because burnt bits will make the sauce bitter. A common mistake is rushing the step with high heat, which causes the butter to foam and the onions to caramelize unevenly. Maintain a sheen on the melted butter and watch for visual cues, the onions should look soft and glossy.
Add flour and cook for 1 minute or until the mixture becomes fragrant.: At this point you will notice a faint toasty aroma as the all-purpose flour cooks, which is important to remove raw flour taste and build body for the sauce. The texture will change from slick to slightly grainy, and that visual shift means the flour is coating the fats properly. Keep stirring to prevent lumps, and do not let the mixture darken; it should remain pale and fragrant. If you stop stirring the flour will clump and create pockets of starchy texture, which can be tough to eliminate later. A quick test is to rub a little between your fingers to check for any raw powdery feel.
Add milk and stir until the mixture becomes thick.: When you pour in the milk slowly and stir, the flour will hydrate and the sauce will go from grainy to smooth and glossy as it thickens. You should stir constantly at first, scraping the bottom, so the sauce develops evenly; bubbles will form gently around the edges, and that simmering breath is a sign the starches are activating. If the sauce looks too thin, continue to simmer and stir until it coats the back of a spoon; if it becomes too thick, a splash more milk will loosen it without losing creaminess. Avoid high heat or rapid rolling boil because that can make the sauce break and separate, leaving a curdled look. A frequent error is adding the milk too quickly, which can create lumps, so add in a steady stream and whisk if needed for a satin finish.
Add corn and cheese. Cook and stir until the cheese melts.: When you introduce the thawed corn , the mixture gains bright color and a hint of sweetness that contrasts with the savory base; stirring will incorporate the kernels and you will hear the gentle patter as they nestle into the sauce. Lower the heat and sprinkle in the shredded Cheddar cheese in batches, allowing each addition to melt into glossy strands. The aroma will shift toward a warm, cheesy note and the sauce will become silkier; stop stirring as soon as it melts to avoid over working the cheeses, but keep the pan warm so the strands run together. If you overheat the cheese it can become grainy, so patience is key: gentle heat and gradual incorporation produce a smooth final texture. Watch for visual cues, the cheese should disappear into the sauce in smooth ribbons, and taste to adjust salt as needed.
You can serve it straight from the stovetop or you can sprinkle on some additional cheese and heat in the oven until the cheese melts.: The choice here affects the final presentation and texture, stovetop serving keeps the sauce glossy and creamy, while a brief oven finish with extra Cheddar cheese creates a bubbly, slightly browned top. If you opt for the oven, transfer to an ovenproof dish and use medium heat to melt and lightly brown the cheese; the top will singe to a toasted aroma and offer a contrasting crust. When serving from the stovetop, the velvety texture will be at its peak, and you should serve immediately because it thickens as it cools. A common slip is leaving it under heat too long before serving, which concentrates the sauce and can make it gluey, so time your oven or serving moment carefully.