If you are from a member state of the European Union, you just need to have your DNI or passport in order. If you are coming from a non-European country, you will need to apply for a student visa in your country of origin or residence and, once you arrive in Spain (within a maximum period of 30 days), you will need to apply for a student card (NIE).
In terms of medical insurance, if you are from an EU country, you will need to bring your European Health Insurance Card (EHIC) with you. If you are coming from a non-EU country, you should take out medical insurance before you arrive. At Cohousing, we offer the option of taking out comprehensive insurance. Ask us about this and we will advise you.