Peel your onions and cut them into half or quarters. Cut into not too thick and not too thin slices. All should be the same.
Heat up a pan and add your butter. Melt butter and stir in onion slices.
Keep over a medium heat setting and sauté onions until translucent.
Takedown the heat a notch and season with salt, black pepper, and if you want you can add sugar too. Stir mix.
When the onions start to get some color, take down the heat further to the minimum stove setting. Or else your onions will burn and won't caramelize.
Keep cooking it on slow heat for about 40 mins or until you are satisfied with the caramelization degree. Stir occasionally to prevent the onions from burning.
The onions will get sweeter over time and the quantity will reduce significantly. Decide if you want them to be light brown or darker brown. Take from the heat.
Use in your favorite food as a topping, in dinner meals, breads, dips etc.
Notes
Pick an onion variety that you like. I used purple onions because that's what I got here. Yellow ones are more suitable, but purple onions are not that sharp too. 3 large onions equal to 5 medium-small onions.
Use a non-stick PFOA and BPA-free skillet or frying pan. That way the onions are less likely to burn.