In the same pot, sauté onions, garlic, and mushrooms until softened. Sprinkle flour over the vegetables and stir to coat. Gradually add beef broth and wine (if using), stirring constantly until thickened. Return beef to the pot, add carrots and peas, and season with salt and pepper. Simmer for 1–2 hours until beef is tender.