Cook the beans, retaining their cooking water.
Remove the leaves from the chard stalks and shred them. Cut the upper part of the stalks into matchsticks. Blanch the stalks first in boiling salted water until tender – 5 minutes or so – then briefly blanch the leaves.
In a large saucepan, gently fry the garlic cloves in the olive oil until light