The distinction between the indefinite articles a and an is straightforward: use a when preceding a vowel sound; use an when preceding a non-vowel sound. Thus a one-time event, an epoch, a university, and an umbra.
British and American English sometimes differ on voicing leading letters. While American English prefers an herb, British English writes a herb. This phonetic difference does not continue to all h- words. A minority of writers believe the leading h is a weak sound when the second syllable is stressed and choose to precede many h- words with an. Both H.W. Fowler and Bryan A. Garner advise against this interpretation: prefer a historic, a hypothesis, a hereditary, a hallucinatory, a hysterical, etc. in both American and British English.