Preheat the oven to 200°C/400°F/gas mark 6.
Add the butter to a pan and gently melt over a low heat. Stir in the flour and keep stirring until a thick paste (roux) is created. Cook for a further 2 minutes.
Using a balloon whisk, gradually pour over the milk, whisking as you go. If the mixture appears to separate or split, whisk until it comes together before adding any more milk. Once all of the milk is added, whisk continuously for 5–6 minutes and keep the pan on the heat until you have a thick, smooth sauce.
Remove from the heat and fold in the grated cheese, then season with a pinch of salt and plenty of black pepper.
Stir in the butter beans, then pour into an ovenproof dish. Bake in the oven for 20–25 minutes until golden and bubbling.