1. Peel and chop the onion and the garlic. In a kettle, bring a little over 2 cups of water over low heat until it boils.
2. Bring a medium saucepan over low heat. When warm, sprinkle the olive oil and add the onion. Season with a pinch of salt and saute for about 2 minutes, until softened. Add the chopped garlic gloves and stir for another 1 minute.
3. Add the rice and stir well to wrap all the grains with the olive oil for about 1 minute. This helps to loosen the rice after cooking.
4. Measure 2 cups (boiling) water and water the rice. Season with the salt, mix well and raise the heat to medium, do not stir anymore.
5. Once the water reaches the same level as the rice, reduce the heat and partially cover the pan. Cook until the rice absorbs all the water - to check if the water has dried, drill the rice with a fork and gently remove some grains from the bottom of the pan; if it is still wet, let it cook a little more.
6. Turn off the heat and keep the pan covered for 5 minutes to finish cooking on the steam itself. Then, loosen the beans with a fork, transfer to a bowl and serve hot.