The most important step in making an excellent French onion soup is to thoroughly, patiently caramelize your onions. Keep the heat medium-low and keep stirring them until they become a deep golden color; this can easily take 30 minutes or more. Don’t be tempted to crank up the heat; slow caramelization brings out the onions’ sweetness and their ultimate oniony essence, the very basis of French onion soup. If your recipe has you slicing what looks to be a mountain of onions, you’re on the right track: they’ll cook down as their water is released and they caramelize.
Use the best quality stock you can get your hands on (preferably homemade). Many hounds like some fresh thyme leaves in their French onion soup, and some add wine–red or white–to deglaze the onions before adding stock. It’s classic to finish the soup with a dash or two of cognac, but sherry and port also add wonderful nuance to the flavor. Gruyere is the preferred cheese for topping a crouton of toasted bread and browning in the oven until it’s molten and bubbly, though MMRuth likes to add a little fontina for its meltability.