H is confusing in English: we have a Germanic tradition which says it must be pronounced, and a Latin(French) tradition which says it must be silent.
Ignore any written rules about this. You use "an" when the next *sound* is a vowel. It's smoother to pronounce that way.
So: a horse, a house, a hair - the H is pronounced here.
But: an hour, an honour, an heir - the H is silent.
Same with words beginning with U. If it's a basic vowel "uh" such as umbrella, unusual, up-side, then "an" applies. If there's a "yuu" sound as in university, utopia, Uruguayan, use "a".