From 16 January 2024, British citizens living abroad who have previously lived in the UK or been registered to vote in the UK at some point in their lives, are now eligible to register to vote in UK general elections regardless of how long they’ve been living outside the UK. A new law has removed the previous 15-year time limit.
Consult www.gov.uk Living in Spain https://www.gov.uk/guidance/living-in-spain#voting of requisites and how to go about it.