Over medium heat, heat a drizzle of olive oil in a large frying pan. Add the courgettes and fry until lightly golden and softened.
Add the garlic and cook for another minute. Transfer to a 10-inch (25 cm) diameter ovenproof dish. Preheat the oven to 375°F (190°C/170°C fan).
In a separate small saucepan, melt the butter. Once melted, add the flour and mix together. Cook for 1 minute. Then pour in the milk bit by bit, whisking as you go, to make a smooth white sauce.
Once thickened, add the cheese, keeping some back for the top. Add the cream, season well with salt and pepper, then stir.
If you're not using cream, just add a splash more milk until it's the right consistency. The sauce is ready when it coats the back of a spoon. Run your finger through the sauce on the spoon, and if the line stays clear without the sauce running back together, it’s ready.
Pour the cheese sauce evenly over the courgettes. Sprinkle with the reserved cheese and breadcrumbs.
Bake for 25–30 minutes until the topping is golden and crisp, and the sauce is bubbling at the edges. Allow to rest for a few minutes before serving.