I once had to go to a clinic while traveling, and since then I've been carefully researching medical coverage limits, including the offers at
https://www.globelink.co.uk/policy-options/spain-travel-insurance.html for Spanish residents. It's helpful to save the emergency number and insurance policy details on your phone in advance. I also keep electronic copies of my documents in the cloud in case of lost luggage. Do you read the procedures for seeking medical care in advance?