Cover the beans with about 2 inches of water and soak overnight, about 8 hours. Rinse the beans, add fresh water and cook in a pot or pressure cooker until they are cooked and soft when pinched between your fingers. Make sure they don’t get mushy.
Blanch the tomatoes in hot water for a few minutes until the skins start to peel away. Remove and discard skins. Purée the tomatoes in a blender.
Saute onions, peppers and garlic in a little oil. Once they’ve softened and lightly browned, add to a blender jar and purée to a coarse paste. Reserve pan.
Tip the onion mixture back into the pan and add the cooked beans and puréed tomatoes. Season with chilli flakes and salt. Cover and cook over a medium heat for 30 minutes, stirring occasionally, until the sauce reduces and thickens to coat the beans.
Once you get the right consistency, add sugar and red wine vinegar. Taste and adjust seasoning. Cook for 5 minutes, take off the heat, and serve.
To store, cool to room temperature. Decant into jars and refrigerate. Can be kept refrigerated for up to 2 weeks or frozen for up to 6 months.