Upvote:1
When you say "for 24 hours" do you mean a little longer or little less than 24 hours?
If you, as you wrote, intend to leave the airport, you'll need to go through border control. You can apply for a Visitor in Transit visa, which will let you leave the airport. You will need to prove that you intend to leave the UK within 48 hours, for example by showing them the ticket for your onward flight.
If you stay for less than 24 hours and don't intend to leave the airport, apply for a Direct Airside Transit visa instead.