Use the indefinite article a when preceding a non-vowel sound, including /y/ and /w/; use an when preceding a vowel sound. Thus write a one-time event, an epoch, a university, and an umbra.
American and British English sometimes differ on whether to voice unstressed leading letters. While American English prefers an herb, British English writes a herb. This phonetic difference does not apply to all words beginning with an h, which usually follow an a. 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.