Heat oil in a saucepan over medium-high heat. Add onion and saute until translucent, then the garlic. Cook for a minute or until garlic is fragrant. Add in cumin and pepper and stir in over heat for just a minute. Add in the sugar, salt, and rice, stirring. Continue to stir until the edges of the rice are just becoming translucent, about 2 minutes.
Immediately add coconut milk and stock. Bring to a boil and reduce to a slow simmer, uncovered. Cook for about five minutes, stirring now and then, then add the beans along with any of the thick liquid in the can. Add the lid and turn down the heat, adjusting if necessary to maintain a low simmer until rice is done and tender, stirring every now and then, about 10 minutes.
Turn off heat, remove the lid, fluff rice (it should be thick and moist), and replace lid; let sit for five minutes off heat before serving. Taste and adjust seasonings.
Notes:
Find it online: https://frugalhausfrau.com/2019/02/18/guatemalan-rice-beans/