Use something like 'sky scanner' website - this will show you a whole month of flights and prices from one airport to another, so you can pick cheaper dates. Instead of typing in exact days, you can pick the 'whole month' option.
When you have found dates that suit, then try something like Booking.com and put in the exact dates and city centre.
Then, when you have found accommodation you like, go onto Trivago.com or Kayak.com and type in the name of the accommodation and the dates. These companies will search the interweb to find out where the exact same room is offered the cheapest.
Then - look on trip advisor or similar to cross check the reviews on there. You can look at other travellers photos too. (Last time, I thought I found a brilliant hotel for long weekend, read the trip advisor reviews and they mentioned noise on the roof bar, I dug a little more and found that it was owned and run separately by a nightclub until 4am each morning!! So hotel had 4, but reviews for sleeping were 1 )
Look to see if they include breakfast or not.
Then, reserve!
Sometimes you can reserve and pay at the hotel desk on arrival. This can cost more, often 'non-refundable' rooms are cheaper, but are non refundable if you don't travel!
Have a lovely, lovely time. If you are unsure about doing it separately like this, Jet2 are a great company for Spanish city breaks, and include flights and transfers.