Prepare the Mushrooms: Remove any tough mushroom stems, then thinly slice the mushrooms. Chop the shallots and mince the garlic. Soften the Aromatics: Place a large sauté pan with a lid over medium heat. Add the butter, chopped shallots, minced garlic, and dried thyme. Sauté for 3–5 minutes, stirring as needed, until the shallots have softened. Cook the Mushrooms: Add the sliced mushrooms to the pan and sauté for about 10 minutes, allowing them to soften and cook with the buttery aromatics and thyme.
Add the Rice and Liquids: Stir the long-grain rice into the mushroom mixture, then pour in the vegetable broth or water and dry sherry. Season with 1 teaspoon salt and 1/4 teaspoon ground black pepper, stirring to combine. Simmer the Rice: Cover the pan and bring the mixture to a simmer. Once simmering, reduce the heat slightly and continue cooking for approximately 20 minutes.
Check for Doneness: Continue cooking until the liquid has been absorbed and visible vent holes have formed across the surface of the rice, indicating that the rice has cooked through.
Rest the Pilaf: Remove the pan from the heat and leave it covered for 10 minutes, allowing the cooked rice to rest before serving.
Fluff and Season: Remove the lid and gently fluff the rice with a fork. Taste the pilaf and adjust the salt and pepper as needed before serving.