Drain the canned corn in a sieve to remove excess water.
Finely chop the onion and bell pepper.
Heat butter in a pan, then sauté the corn and vegetables.
Add mayonnaise, sugar, salt, and pepper, and mix well.
Evenly spread cheese on top.
Cover with a lid and cook on low heat until the cheese melts.