Heat vegetable oil in a large skillet over medium-high heat
Add diced onion and minced garlic to the skillet. Cook until fragrant and onions are translucent
Push the onions and garlic to one side of the skillet and pour the beaten eggs into the empty space. Scramble the eggs until cooked through, then mix with the onions and garlic
Add cooked rice to the skillet, breaking up any clumps with a spatula. Stir-fry for a few minutes to heat up the rice and mix it with the vegetables. Stir in soy sauce, mix well to evenly coat the rice and vegetables
Add pineapple chunks and frozen carrots and peas to the skillet. Continue to stir-fry for another 2-3 minutes until everything is heated through
Taste and adjust seasoning with salt and pepper if needed
Remove from heat and garnish with chopped green onions and toasted coconut flakes if desired