You must fill in your Passenger Locator Form up to 48 hours (2 days) before arrival and declare all the countries you have visited or transited through in the past 10 days before you arrive in the UK. Booking for the Day 2 & Day 8 tests has to be done before you take your flight to the UK (Book here). After this, you will be provided with a Reference number that you need to add to the Passenger Locator Form.
The details required in the Passenger Locator Form:
your Passport details or the travel document you’ll use when you arrive at the UK border
your travel details, including times and dates
the address where you will stay in the UK (if applicable)
booking reference numbers for any COVID-19 tests you must take after arriving in the UK
the invoice number for your quarantine hotel booking if you need one
to prove your vaccination status, and say where you were vaccinated