Bednobs, it's a condition of travel - I think you have to prove that you will do a LFT when you return. Some airlines, holiday companies etc need proof that you have got this arranged - and you get a reference number to show that you have it arranged.
Rosie, my daughter arranged for hers while she was away, and got a reference number. Other friends did it before they left the UK, and got a reference number.
I think technically you could book before going away, depending on how long you are going to be gone.
Be careful though. We booked during our holiday (giving the dates) and the company dispatched a signed for package which reached our house 2 days before we got home!
Fortunately in our case our son was home to sign for it.
Randox do one for £21.50, as shown in the link. You have to put in a discount code for that price. Just put in easyjet2021 - there is no check to see if you are flying with them.
English rules for those fully vaccinated (I believe Scotland, Wales and NI are similar):
You must book and pay for either a Lateral Flow or PCR test before you leave for England. You are required to provide your booking reference on the "Passenger Locator Form" (PLF) which you must submit no more than 48 hours before you are due to arrive. The test must be taken by the end of Day 2 after your arrival.
In practice you can book and pay for the test as early as you like. You can near enough complete the PLF before you leave England if you wish. You can save the details and return to them later. However, if you do not revisit it within seven days it gets wiped and you have to start again. However, you cannot submit it more than 48 hours before your planned arrival back there. This means you need to have some means of submitting it from abroad (either a phone or a computer with internet access). If you don't have your test booking reference you will not be able to submit your PLF and will probably be denied boarding abroad.
You get the reference number to put on the PLF when you book the LF test so you can book it before you go or when you are away. I've just booked mine. It's despatched on day 0. Day 0 being the day of arrival in the UK