In Spain between mid June and mid September you will need to protect yourself from mosquitos at night.
Just go to any supermarket and buy yourself an anti-mosquito machine.
The most old fashioned are a small heater which you plug in and you change the pastille every night.
The more modern ones have some sort of insecticide tank and you can leave them plugged in for up to 45 nights.
That will solve your problem immediately.
If you have a place in your home where you sit out in the evenings such as a teraza or patio you may need an anti mosquito spiral.
They are green spirals and you light them. They slowly burn down emitting an insecticide smoke.
The smoke is slightly unpleasant but it is much better than being bitten.
To avoid the smoke you can put then on the floor rather than the table.
The only place where it is difficult to protect yourself from mosquitos is if you eat outside in the evening at a restaurant.
Really the restaurant itself should do something to protect you but this is not that normal, especially in a village.
The best thing to do in this case is to spray yourself with an insect repellant.
Insect repellant is probably the least effective method and if you are in your own home you should always use a machine.
If you do get bitten by a mosquito never scratch it.
If you are reading this because you have been woken up by mosquitos and all the shops are closed then look for some garlic in the kitchen.
Smear some garlic on your skin because it repells the mosquitos.
An aspirin or other painkiller may help the itch and let you get back to sleep.
Germolene or TCP are very good on insect bites because they have a local anasthetic. These are UK products and are not available in Spain.
How do mosquitos find you?
The air that you breathe out has a slightly higher concentration of carbon dioxide than the surrounding air. Mosquitos have a very sensitive way of measuring the carbon dioxide in the air and find you by finding your breath.