In a non-stick medium pan, add the chopped bacon and cook until the fat is released then add the onion and garlic and cook until just soft over a low heat.
Add the beans, coconut milk, ham or sausage, cayenne pepper and thyme and bring to the boil. Allow it to cook, stirring for about 1 minute.
Add the rice and 450ml boiling water, turn down the heat to barely a simmer, cover and leave undisturbed for about 25 minutes.
When the rice is tender, stir gently and add any leftover vegetables, then season to taste.