Peel and trim ends from onions. Halve onions from root to tip, then slice thinly from root to tip. See step-by-step photos and video for visual cues. Cutting from root to tip (as opposed to crosswise) is the way to ensure the onion slices will hold enough of their shape while caramelizing, rather than dissolving into mush.
Heat oil and melt butter together over medium heat in a 10-inch frying pan with a heavy bottom.
Add onions and stir well to coat with oil and butter. Add rosemary, thyme, and salt, and stir again.
For the first 20 minutes or so, the onions will sweat a lot and reduce in volume substantially. Stir occasionally during this time to keep them cooking evenly, and adjust the heat as necessary to prevent burning. Don't expect to see too much color on the onions during this time.
During the next 20 to 40 minutes, the onions will really start to caramelize. Your job during this time is to stir the onions not too little but not too much. Allow them to get a little bit browned on the bottom without burning, and then scrape up the browned bits while stirring the onions with a metal spoon or spatula. Typically the heat should be in the medium to medium-low range, but your mileage may vary.
Over time you'll learn exactly how dark you like your caramelized onions. Our favorite point to stop is when they're a gorgeous mahogany brown and just on the cusp of jammy. At this stage they're super sweet and savory and not at all burned.
Remove any large herb stems before using these babies in whatever recipes you like (or just spooning over all your hopes and dreams).