H with indefinite article
The normal use of the indefinite article in English is to have an before a vowel, and a before a consonant. As always in our language, the actual position is a little more complicated than this. The consonant '-h-' is a case in point. It ought, according to rule, to be used with a - and it usually is, except where the '-h-' itself is silent, as in 'hour', which is a homophone of 'our', and 'honour', etc. Here, the '-h-' is never pronounced, and the indefinite article is always an. But there is a group of words which start with '-h-' which is pronounced, and which nevertheless take an. Such words are not easily predicted - not least because different groups of speakers have different usages. Old-fashioned speakers, often males of a certain age and education, are more likely to use an with 'historian' and 'hotel'.
The group of speakers who use an with such words, whether they pronounce or do not pronounce the '-h-', often coincides with academics, perhaps most of all in departments of History or Literature. Notice the prejudices of those who teach you, and - if it does not compromise your principles to do so - try to meet them. It seems to AWE to be a matter of courtesy. Otherwise, our advice to students in the modern age is to ignore all the above. Use an for words beginning with '-h-' only where the '-h-' is silent - is not pronounced. In front of an '-h-' that you actually pronounce, use a, for example "I haven't got a hope."
The complications mentioned above include the facts: 1) that no one, to my knowledge, ever says "an history", though some say "an historian" (Wells records that 6% of the British population in his 1998 survey dropped the 'h' in 'historic' after an an, although not mentioning the figure for 'history'); 2) no one uses "an herald", though "an heraldic [...]" is not unknown; and 3) that the most old-fashioned speakers who use an do not pronounce the '-h-' . This dates back to upper class pronunciation in the Edwardian period which dropped the '-h-' in such words as 'hotel' and 'historic'.
Go to H - dropping the h for a more derogatory use of the term.