We use “a” before when the vowel sounds like a consonant.


a uniform
a user
a United Nations official
a UFO

Here are some more.
a university
a unique pencil
a once-in-a-lifetime opportunity