I've seen mixed advice on this. In the US it seems mandatory but I'm not sure it's as common in the UK. Does it actually make a difference?
In the UK it's less expected than in the US, but it definitely doesn't hurt. Keep it short — 3 sentences max. Say you enjoyed the conversation, mention one specific thing you discussed to show you were engaged, and confirm your enthusiasm for the role. That's it.
I've been on hiring panels and honestly a good follow-up email can tip a close decision. It shows professionalism and genuine interest. Send it the same day while it's fresh.
One caveat — if you had a bad interview and are having second thoughts, maybe hold off. An enthusiastic email you later have to follow up with 'actually I've decided to withdraw' is awkward!