From UK to Spain, that’s nothing to worry about. People get friendlier, and food and weather get better. I am sure you’ll have a wonderful time there. Latin people are really easy to speak to, just be relaxed and respectful. The same thing you’d do to speak to strangers in London will work in Spain, if anything Spain is way less formal than England.
The important stuff is just to respect basic safety (not going in weird areas that look dangerous, having a copy of your identity paper and some cash at the ho(s)tel, avoiding dressing like a tourist or looking at a paper map in the street…).
Travelling solo is great as you can plan easily and on last minute. And if you don’t like to be alone, you can always tag along with people from the hostel and visit the city with them.
In a hostel, the easiest way to speak to people is “hey, where are you from ?” it works every time, then try to elaborate on why they are here or speak about they country of origin.
If you are in a hotel, some of the staff is basically paid to speak with you and if you go there while they are not busy they’ll be happy to speak for longer periods of time, they will have invaluable information for you, just ask them.
If you are using couchsurfing, it’s even easier as the host will speak to you and introduce you to his friends if the situation arise.
The hardest is definitely groups of strangers in the street, so just use something situational. For example, ask someone if the restaurant they are currently eating at is good and whether they charge tourist prices in this place, make a joke about how hard it is to find your way with all those things in Spanish and all those people using the wrong side of the street and ask for help, spot other tourists and ask them if they are here for the same thing as you and what is the best thing they saw so far in the city… Do it with a smile, everything will be OK.
If you are travelling in Europe, the risk to have a cultural mismatch is very low, just avoid generalities and stereotypes. If you go outside Europe, I suggest to google a bit about cultural habits before going there. Or you can ask the flight attendants (if you take the national company of this country) or the ho(s)tel staff about it.
In my experience, people are very pleased if you try to speak their language or ask them targeted questions about the local culture that normal tourists don’t ask.
As far as ending conversation goes, it’s quite easy… You will be a tourist, with a limited time to do a lot of things. Just say you need to go because you don’t want to miss that bus that goes to this place, that you want to take photos of that thing before sun goes down, that you planned to see a lot of things today and are afraid you won’t be able to do it if you stay longer… Being a tourist just gives you a lot of excuses to use, and they are usually true so you don’t even need to lie.
In terms of travelling, my advice is to do whatever sounds great to you, even if that’s not what you planned initially. I know I like to take a walking tour on the first day to have an overview of the city where I am in, and to ask question to the guide at the end. Based on that I adapt my plans ( I spot places to take photos, want to try something the guide mentioned…).
Hope this helps,