Grate the Zucchini: Start by coarsely grating the zucchini using a box grater or food processor. Place the grated zucchini in a colander and let it drain for 3–4 minutes. To remove extra water, wring it in a clean kitchen towel.
Heat the Oil or Butter: In a large skillet, heat the olive oil or butter over medium heat.
Cook the Aromatics: Add the minced shallots (or garlic) to the skillet. Sauté for about 1–2 minutes until fragrant and soft.
Add the Zucchini: Toss the grated zucchini into the skillet and stir to coat it in the oil or butter.
Cook and Reduce: Continue cooking the zucchini over medium to medium-high heat, stirring occasionally. The zucchini will release water as it cooks. Keep cooking until it thickens and transforms into a spreadable consistency, about 10–15 minutes.
Caramelize the Zucchini: Once the zucchini has reduced, lower the heat if necessary to avoid scorching the bottom. Scrape up any browned bits for added flavor.
Season and Serve: Season with salt and pepper to taste. Serve immediately or let it cool for storage.