Spain has agreements with several countries that allow you to exchange your licence without sitting a test, but there's a deadline and conditions. Everything explained here.
Depending on your country of origin, you may be able to exchange your driving licence for a Spanish one without sitting the theory or practical test, just paying a €27 fee and meeting the requirements.
This is one of the most important processes to sort in your first months in Spain, and one of the most overlooked, with serious consequences for those who miss the deadline.
Important: A foreign driving licence allows you to drive temporarily in Spain during the first months after arrival, but there are specific conditions and deadlines that vary depending on your type of residence. Verify your exact situation in advance.
If you already have or are about to buy a car in Spain, I can help you take out insurance with your foreign licence, while the exchange process is underway.