Heat the vegetable oil in a large skillet or wok over medium-high heat.
Add the sliced onion and sauté for about 2-3 minutes until it becomes translucent.
Stir in the minced garlic and ginger, cooking for an additional 1-2 minutes until fragrant.
Add the chicken pieces to the skillet, seasoning with salt and pepper. Cook for approximately 5-7 minutes, stirring occasionally, until the chicken is browned and cooked through.
Pour in the coconut milk, soy sauce, fish sauce, and brown sugar. Mix well to combine all the ingredients.
Bring the mixture to a simmer and let it cook for another 10 minutes, allowing the flavors to meld and the sauce to slightly thicken.
Add the chopped basil and red chili flakes (if using) to the skillet, stirring to incorporate them into the sauce. Cook for 2 more minutes.
Taste and adjust the seasoning if necessary.
Serve hot over steamed rice or noodles, garnished with additional basil if desired.