I have always been recommended to look for a repellent that contains Deet as this is the most effective agent in repelling midges. However, in practice I find these repellents only work for a short time and you are back to getting eaten again quite quickly.
Some old wives' tales claim that bog myrtle leaves, crushed and rubbed on the skin to give off their strong smell, can be a repellent. This method certainly provides relief but is not very effective.
If you really want to keep away from midges, avoid being outside in the evening and at dusk. Also avoid shade and areas of boggy ground. I've found the midges to be much more aggressive in the north west Highlands than in other parts of the country.
Unlike mosquitoes, midges do not normally come into your home. You can comfortably sleep with your window open without any problem.
Another biting bug in Scotland, not so well-known but worth looking out for is the horsefly (local known as the "Clegg"). This is a large insect. It is found in areas where there are horses but also where there are many deer - that is, most of Scotland's country-side. I used to kill 6 or 7 every year. They are relatively slow and easy to swat but they don't make much buzzing and might go unnoticed until they bite. I've only been bitten once and it felt like a large hypodermic needle was being pushed into my shin. The wound they leave can take months to heal completely.