01 - Preheat the oven to 400°F.
02 - Boil peeled and cubed potatoes in salted water until tender, approximately 15 to 20 minutes. Drain thoroughly.
03 - Mash potatoes with unsalted butter and milk until smooth. Season with salt and pepper to taste. Stir in egg yolk if using, then set aside.
04 - Heat olive oil in a large skillet over medium heat. Add finely chopped onion, minced garlic, and diced carrots. Sauté until softened, about 5 minutes.
05 - Add ground beef to the skillet. Cook and break up the meat until browned and cooked through, about 7 to 8 minutes.
06 - Stir in tomato paste, Worcestershire sauce, dried thyme, dried rosemary, salt, and black pepper. Cook together for 2 minutes.
07 - Sprinkle all-purpose flour over the mixture and stir well to combine. Cook for 1 minute to remove raw flour taste.
08 - Pour in beef broth while stirring, scraping up any browned bits from the pan. Simmer for 5 minutes until the mixture thickens slightly.
09 - Stir frozen peas into the filling and cook for an additional 2 minutes.
10 - Spread the beef filling evenly in a 2-quart baking dish. Top with mashed potatoes, smoothing the surface. Optionally, create a decorative pattern with a fork.
11 - Bake in the preheated oven for 20 to 25 minutes, until the topping is golden brown and the filling is bubbling.
12 - Allow to rest for 10 minutes to set before serving.