Before departure: All travellers to the UK aged 12 and over have to show proof of a negative test, even if they are fully vaccinated.
This can be a PCR or a lateral flow test, and must be taken in the two days before departure for the UK.
You'll need to find a private test provider for this - free NHS lateral flow kits are not allowed.
The test can be taken either in the country where you start your journey, or in another country en route to the UK (for instance if you're travelling overland).
If you test positive, you should follow local rules in place in the country you're in, and do not travel to the UK.
After arriving in the UK, you have two days to take another test - which must be a PCR.
This must be booked before you travel, and bought privately from a government-approved list of providers.
While you are waiting for a result, you must self-isolate - whether or not you have been vaccinated. You can stop self-isolating if your test is negative.
Everyone aged five and over (11 and over in Scotland) must take these tests.
I found this helpful, and posted it here for others.