Be sure to read the notes at the end of the recipe, as there are a couple of tweaks that can make a real difference in the outcome.
Heat oven to 350 degrees.
Here's the easiest way to mix this up, especially if you're doing a big batch:
Grate the cheese and sprinkle into the bottom of your baking pan. Sprinkle the chopped onions and red pepper, if using, on top of cheese. Stir the dry ingredients together in a small bowl. Put the butter in a medium bowl and microwave at 50% power for about 45 seconds, then beat in the eggs and the buttermilk or water, then the creamed corn. and chiles, then mix in your combined dry ingredients. Pour that mixture into the prepared pan over the cheese/vegetables, trying not to disturb that layer too much, and bake until set and somewhat brown on top, 35-40 minutes. You can make it a little more custardy by having it still be somewhat jiggly in the center, or you can think of it as more like cornbread and bake until it’s firm. I like it on the softer side, as then it’s more like a spoonbread. (If you're making the bigger batches in the half-size chafing-dish pans, these will need more time to bake--more like an hour.)
*I've usually drained the chiles at least somewhat, but the last time I made this I was in a serious hurry and didn't do so. While the casserole was still good, it was a little watery on the bottom. As I thought about it, though, I realized that I didn't want to just throw out that chile liquid because it has flavor. So here's my advice: drain the chiles into the container you're going to use for measuring the buttermilk or water, then add your liquid of choice up to the cup line. I would be fairly vigorous in draining, either pressing down on the chiles with the lid while they're still in the can or putting them into a strainer and pressing down over your cup measure.
**I would stick to the Cheddar/pepper jack combo. I used Mexican queso fresco recently and wasn't really pleased with the results--it came out kind of curdled, and queso fresco is pretty mild. A good sharp Cheddar and the peppery jack cheese have always worked great.