You’ll need a visa to pass through the UK in transit
You should apply for a Visitor in Transit visa if you arrive on a flight and will pass through immigration control before you leave the UK.
Transiting without a visa
You might be eligible for ‘transit without visa’ if:
you arrive and depart by air
have a confirmed onward flight that leaves on the day you arrive or before midnight on the day after you arrive
have the right documents for your destination (eg a visa for that country)
How to confirm the second point?