Caramelize the onions: In a large pot or Dutch oven, melt the butter with olive oil over medium heat. Add the onions and cook, stirring occasionally, for about 20-25 minutes until they are soft and golden brown. Sprinkle the sugar over the onions to help them caramelize more evenly.
Add garlic: Once the onions are deeply caramelized, add the minced garlic and cook for another 1-2 minutes until fragrant.
Deglaze with wine (optional): Pour in the white wine to deglaze the pot, scraping up any browned bits from the bottom of the pot. Let the wine cook off for about 3-4 minutes.
Add broth and seasoning: Stir in the beef broth, bay leaf, thyme, salt, and pepper. Bring the soup to a simmer and cook for 20-30 minutes to allow the flavors to meld together.
Prepare the bread: While the soup simmers, preheat your oven to 350°F (175°C). Arrange the slices of French bread on a baking sheet and toast them in the oven for 10-12 minutes or until golden and crispy.
Assemble and serve: Once the soup is ready, remove the bay leaf and ladle the soup into oven-safe bowls. Top each bowl with a slice of toasted bread and a generous amount of shredded Gruyère cheese.
Broil the cheese: Place the bowls under the broiler for about 3-5 minutes or until the cheese is melted, bubbly, and golden brown.
Serve hot: Remove from the oven and let it cool slightly before serving. Enjoy your delicious, homemade French onion soup!