In a large skillet or wok, heat vegetable oil over medium-high heat. Add minced garlic and ginger, sautéing for about 30 seconds until fragrant.
Add the diced chicken to the skillet, stirring until heated through, about 2-3 minutes.
Push the chicken to one side of the skillet. If using, pour the beaten egg into the other side and scramble until fully cooked.
Add the cooked rice, pineapple, peas, and carrots to the skillet. Stir everything together, breaking up any clumps of rice.
Pour in the soy sauce and oyster sauce (if using), mixing well to combine. Drizzle sesame oil over the top and season with salt and pepper to taste.
Cook for an additional 3-5 minutes, stirring occasionally, until everything is heated through and well combined.
Remove from heat and stir in chopped green onions before serving.