Cut onions in half. Slice each onion half lengthwise into ¼-inch half-moons.
Set a cast iron or nonstick pan with a thick bottom to medium heat. Add butter (or oil), and melt fully.
Add the onions to the pan (if you have more onions that can easily fit in one pan, add them in batches, waiting until onions become translucent before adding the next batch). Cook, stirring occasionally, over medium heat until the onions change color, about 5-10 minutes.
Lower the heat to medium-low and add the brown sugar. Cook, stirring the pan often to prevent burning, until the onions fully caramelize and become golden brown, for about 15 minutes.
For extra brown caramelized onions, cook the onions for an additional 10 minutes. They will be extra sweet, but this will also produce the smallest amount of caramelized onions as they continue shrinking while they cook.
