Heat oil in a large skillet or wok over medium-high heat until shimmering.
Add chopped onion and cook until softened, then stir in garlic and cook for about 30 seconds until fragrant.
Add diced carrots and any firm vegetables, stir-fry for 3–4 minutes until they start to soften.
Add peas and remaining vegetables, cooking until tender-crisp.
Push vegetables to the side and add cooked rice, breaking up any clumps with a spoon or spatula.
Drizzle soy sauce and sesame oil (if using) evenly over the rice and vegetables, then stir to combine and heat through.
Season with salt and freshly ground black pepper to taste.
If using eggs, push rice and vegetables aside, pour beaten eggs into open space, scramble until cooked, then mix with rice.
Remove from heat and garnish with sliced green onions or sesame seeds before serving hot.