Words which have “yew” sound go with “a” instead of “an”, example: a university, a European, a union.
Words which have silent “h” go with “an” instead of “a”, example: an heir, an honour, an hour