Working in Spain
As soon as you start working legitimately in Spain (i.e. paying social security contributions) you can no longer use your EHIC (European Health Insurance Card). Now that you are a fully paid-up member of the tax-paying classes in Spain, your healthcare provisions are the same as for any other Spaniards. These are generous and, as noted elsewhere, envied throughout Europe.
"As soon as you start working legitimately in Spain your healthcare provisions are the same as for any other Spaniards"
Resident in Spain
If you live and work in Spain, it makes sense to apply for a “residencia” as soon as you can. Once you are an official resident of Spain, you will be required to make monthly social security contributions in order to qualify for state healthcare. If you are an employee, the likelihood is that the vast majority of these costs will be borne by your employer; but self-employed individuals will be responsible for making these payments themselves.
Living in Spain (But Not Working)
If you are below retirement age and intend to move to Spain without a job or a taxable income, you may still be entitled to low-cost state healthcare for a short while. If you are an EU national and have been contributing to the social security system in your home country up to the point of your departure, the S1 form may sufficiently cover your needs.
The S1 form (as it does for retirees) allows you to register with your local social security authority in Spain if you have been deemed eligible to receive cover. Until then, though, it is advisable to take out private health insurance because, if something should happen to you, you will not be covered by the Spanish healthcare system.