The following two website links provide useful information on returning to the UK to live, including what UK benefits you may be entitled to after your arrival. You will normally need to pass a Habitual Residency Test (HRT) to access benefits, to prove you plan to return for a while.
http://www.ageuk.org.uk/Documents/EN-GB/Factsheets/FS25_Returning_from_abroad_fcs.pdf?dtrk=true
https://www.gov.uk/guidance/living-in-spain#returning-to-the-uk
Some organisations may be able to help you apply for short-term loans or grants to help cover the travel cost of permanently returning to the UK for those most in need. Click here for more information.