Melatonin is now available from Chemists. You need to do a short online consultation but other than that it’s straight forward to buy
Rather, it looks some online chemists skirt around the rules by having an “online doctor” issue you with a prescription. But the UK-based ones I found were very expensive and it is surely cheaper just to import from the US via eBay etc.