For the beef cheeks, place the cheeks in a large bowl with the onions, chopped carrot, garlic and thyme. Pour over the beer, cover and place in the fridge for at least 12 hours, but preferably overnight.
Preheat the oven to 150C/300F/Gas 2.
Lift the beef cheeks out from the vegetables, pat dry, then season with salt and pepper. Reserve the marinade.
Heat a large casserole or ovenproof pan until hot, add the olive oil and a knob of the butter. When foaming, add the beef cheeks two at a time and fry on each side until browned. Remove and set aside.
Return the beef to the pan with the reserved marinade and add the beef stock.
Bring to a simmer then cover with a lid, leaving the lid slightly ajar so you have a 1cm/½in gap at the side. Cook in the oven for 4-5 hours.
Meanwhile, put the whole carrots, star anise, 100g/3½oz of the butter, a pinch of salt and the sugar into a pan and add enough water to just cover. Set on a low heat and cook for 20-30 minutes, or until the carrots are tender and glazed.
Remove the casserole from the oven and strain the sauce into a saucepan, then place over the heat and cook until the volume of liquid has reduced and is thick enough to just coat the back of a spoon.
Whisk in the remaining butter until the sauce is shiny. Season with sea salt and freshly ground black pepper, to taste.
For the mash, place the potatoes into a pan of cold, salted water and bring to the boil. Reduce the heat and simmer for 12-15 minutes, or until the potatoes are tender.
Drain and return to the pan, then place over a low heat for a couple of minutes to dry the potatoes slightly.
Meanwhile, put the butter and milk into a saucepan and simmer until the butter is melted.
Pass the potatoes through a ricer, then add the hot butter and milk (or cream) and beat to form a very smooth mash. Season, to taste, with salt and black pepper.
To serve, lift out the beef cheeks and place in shallow bowls. Spoon the mash alongside and finish with a generous ladleful of sauce.