On a cheerful note, consideration should be given as to where one wants to rest for eternity. Well! It is the best I can do without being more specific and morbid, but do you know what happens here in Spain? No I do not mean you can live for ever, longer
If the deceased was covered by travel insurance, repatriation can be arranged with a local International Funeral Director or ask the insurance company for advice. If the deceased is not covered by insurance, the next of kin will have to appoint an undertaker in Spain, or an International Funeral director. Cremation is now widely accepted in Spain and there are modern, well-equipped crematoria. Ashes can also be taken back to the UK with minimal bureaucracy. There are no restrictions on movement of ashes within the EU.
If election is made to proceed with a local burial, under normal circumstances, the funeral and burial must take place within 24 hours and in Spain 'burial' often means an above ground crypt. Rights to this are normally held for 5 years, unless specifically purchased in perpetuity. I was once outside a cemetery in a village, talking to a keeper. I asked what happens when there are no next of kin left or willing to pay after five years. I was told that the bones are removed and placed in a common place or grave "there". I may be wrong, but that is when I saw a dog running from the spot that had just been pointed out and I could swear he had a bone in its mouth.