Hi,
As you are not resident in the UK, your state pension is not taxable in the UK. You need to declare your UK state pension in Spain and this is done by completing form DT individual Uk / Spain and send it to the Spanish Tax Authorities. The form and guidance notes can be found here:
Double Taxation: UK - Spain (Form Spain-Individual)
The Spanish tax authorities will send it back to you and you in turn, send it to HMRC, to the address on the form. You also need to send the form with your "Residencia Fiscal En Espana Convenio" from the Spanish tax authorities.
In your tax return you should change the state pension figure to £0.00, if you were not resident in the UK from before 6 April 2023.
Thank you.