Start by preparing the vegetables. Dice the onion, carrots, and bell pepper. Mince the garlic.
Heat the vegetable oil in a large frying pan or wok over medium-high heat.
Add the diced onion and cook for about 2 minutes until softened.
Add the carrots and bell pepper, and cook for another 3-4 minutes until they start to soften.
Stir in the minced garlic and cook for an additional minute until fragrant.
Push the vegetables to one side of the pan and pour the beaten eggs (if using) into the other side. Scramble the eggs until cooked, then mix with the vegetables.
Add the cooked rice to the pan, breaking up any clumps. Stir well to combine with the vegetables and eggs.
Pour the soy sauce and sesame oil over the rice mixture, and toss everything together to ensure the rice is evenly coated. Cook for about 5 minutes, stirring occasionally.
Add the frozen peas and chopped green onions, stirring to combine. Season with salt and pepper to taste.
Cook for an additional 2-3 minutes until everything is heated through and well mixed.