Getting a Transit Guarantee
See the HMRC guidance on applying for a transit guarantee:
https://www.gov.uk/guidance/apply-for-a-customs-comprehensive-guarantee-to-cover-customs-debts
If you are an Authorised Economic Operator (AEO) then you can apply for a full waiver of the guarantee:
https://www.gov.uk/guidance/authorised-economic-operator-certification