Heat butter in a large skillet over medium heat until melted. Cook onion, stirring occasionally until it starts to soften, about 4 minutes. Add garlic and sauté another minute until onion is translucent.
Add zucchini and cook, stirring occasionally, until zucchini is softened and crisp-tender.
Add corn, salt and pepper, and continue stirring and cooking until corn is cooked (if fresh corn) or heated though, about 3 more minutes.