First of all, this is something you will like to do the day before you eat it, as it ensures that all the flavors get locked in the beans and the rice. The recipe is typically made from leftovers so if you want to be authentic you should make it a day ahead for the best flavor.
First put 2 liters of water in a medium pot.
meanwhile the water boils rinse your beans well ,
when the water starts to boil add the beans.
Let them boil at medium heat, cooking time is between 30 and 60 minutes.
Be sure to check the beans, when they are starting to get soft add in the salt to taste, garlic and onion. (be sure you do not add salt until they are tender or they will not cook properly.)
Cook for another 30 minutes.
In a frying pan add oil and the 1/2 of an onion you have left.
When the onion is cooked, take it out, and add your beans with some of the stock keep stirring so they don't stick and fry them for 5 mins.
With a spatula gently press the beans against the pan to release more stock, but do not press them to much.
Next, add the day old cooked rice and mix well until the rice has absorb all the stock keep stirring for a few minutes and it's done.
It is best to serve the next day, just reheat and serve.