Passport.Covid Vaccination Certificate (proof of double vaccination).Book a Day 2 Covid test to be delivered to wherever you are staying in the UK - for most of the UK, this is a lateral flow test (cost about £30); if travelling to Scotland, still currently a PCR test (cost about £40+).Complete...
Read more...
... the UK Passenger Locator Form (you can start this whenever, but can't submit it until within 48 hours of arrival in the UK). You need to provide the reference number for the Day 2 test booking (above) on this form. After you've submitted this, you will receive a copy of the form via email, which also contains a QR code, which will generally be what is checked at the airport.You don't need to take a test in Spain before you leave.
These are the current rules, but they may change in the next month until you travel. You can check for updates on the gov.uk website.
Hope this helps!