While oil is heating in a saucepan over medium heat, dice the onion, add to saucepan when oil is heated. While onion is softening (about 8 minutes), mince the garlic. Add when onion is softened and cook another 2 minutes. Add rice, stir so that it is coated in oil, then add stock, bring to a boil, then cover the saucepan and reduce to a simmer. Cook until rice is tender, about 15 minutes.
While rice is cooking, chop the coriander (cilantro), and chop the chile finely.
When rice is tender, remove it from the heat and let it stand covered about 5 to 10 minutes until any remaining liquid is absorbed. Fluff the rice with a fork, stir in chopped coriander and chile, season to taste with salt and pepper.