Peel and halve the onions. Slice the onions about ¼-inch thick.
Heat the oil or butter or a combination in a very large skillet over medium heat. When the oil is hot, add the onions. Season with salt and pepper, if desired. Cook, stirring occasionally, for about 30 minutes. Make sure the onions aren’t burning, but that they are getting darker. If needed, add a couple of tablespoons of water, if the onions seem to be sticking. See above for more tips on how to caramelize onions evenly.
After 30 minutes, sprinkle over the sugar, if using. Either way, continue to stir and cook for another 15 to 20 more minutes, until the onions are as browned and soft as you like them. Taste and adjust the seasonings as needed. Remove from the heat and use.