'An' is used before words which begin with a vowel sound. Note that we are talking about sounds and not spelling. For example the word "European" begins with the vowel letter 'e' but it is pronounced with the consonant sound / j /. Therefore we say and write, "He's British but he thinks of himself as a European."