Preheat your oven to 350°F (175°C). Grease a 2-quart baking dish generously with butter or cooking spray. Consider lining the bottom with parchment paper for extra insurance against sticking.
If using fresh corn, husk and clean the ears, then carefully cut the kernels from the cob. For canned corn, drain thoroughly and pat dry with paper towels to remove excess moisture.
In a large mixing bowl, whisk the eggs until light and frothy (about 1 minute). Slowly stream in the melted butter while continuing to whisk. Add the sugar and vanilla extract, and mix until completely incorporated.
In a separate bowl, whisk together the flour, baking powder, and salt until evenly distributed.
Add the dry ingredients to the egg mixture, alternating with the milk in three additions. Mix until just combined to avoid overmixing.
Fold in the corn kernels gently using a rubber spatula, distributing them evenly while maintaining the light texture of the batter.
Pour the mixture into your prepared baking dish. Place in the center of your preheated oven and bake for 45-50 minutes, or until the top is golden brown and the center is set but still slightly jiggly. A toothpick inserted near the center should come out mostly clean.
Allow your corn pudding to rest for 10 minutes before serving. This resting period is crucial for the final texture development.