Sauté the Onion and Potatoes: In a large pot, melt butter over medium heat. Add the chopped onion and sauté for 2-3 minutes until softened. Add the diced potatoes and cook for another 2 minutes, stirring occasionally.
Add the Corn and Broth: Pour in the vegetable or chicken broth and add the sweet corn. Stir to combine and bring to a boil. Once boiling, reduce the heat and let it simmer for 15-20 minutes or until the potatoes are tender.
Add the Milk and Simmer: Stir in the milk and let the mixture simmer for an additional 5 minutes. If you prefer a thicker chowder, mash some of the potatoes with a potato masher.
Stir in the Cheese: Reduce the heat to low and stir in the shredded cheddar cheese. Continue stirring until the cheese is fully melted and incorporated into the chowder.
Season and Serve: Season with salt and pepper to taste, and add cayenne pepper or red pepper flakes for extra spice if desired. Serve the chowder hot, garnished with additional cheese or herbs if you like.