Leaving the airport
Apply for a Visitor in Transit visa if you’ll be going through UK border control but leaving the UK within 48 hours.
You can also apply for a long-term Visitor in Transit visa if you can prove you need to frequently pass through the UK over a longer period.
Direct Airside Transit visa (DATV) - £40
Visitor in Transit visa - £54
The cost may vary slightly depending on which country you’re in.https://www.gov.uk/transit-visa/visitor-in-transit-visa