Heat the olive oil. Let the onions and the garlic slowly turn soft and yellow. Add the beans and tomatoes. Boil.
Reduce the heat and slowly simmer until the beans are soft and the liquid has evaporated (be careful, it can burn). Only salt and pepper to taste towards the end.