At Heathrow you will clear security but not customs if your bag is checked through to the final destination.
You won’t need it this time but there is an airside bus transfer between all terminals. Just follow the purple signs for the transfer desks.
Heathrow operates a strict conformance rule so they will scan the onward boarding pass before allowing you to security (you need to arrive 40 minutes I think before the flight).