You need to prove your medicine is prescribed to you if:
it contains a ‘controlled drug’
you have it on you when you’re entering the UK
What sort of proof you need depends on the category of drug and how much of it you’re bringing in.
If you’re leaving the UK with medicine that contains a controlled drug, check with the embassy about the rules for the country you’re going to before you travel.