The proper usage for “a” or “an” is not whether it comes before a word starting with a consonant or vowel, it’s whether it comes before a word that sounds like a consonant or vowel.
An hour (hour sounds like the vowel “o”)
A hiker (hiker sounds like like the consonant “h”)
An only child (only sounds like the vowel “o”)
A one-horse race (one sounds like the consonant “w”)
An MBA (MBA sounds like the vowel “e”)
A mechanic (mechanic sounds like the consonant “m”)
So it’s the sound of the word, not just the first letter. I have to say, I totally do not remember ever learning the rule that way, but it’s way easier to remember.
Now you’re a little smarter, Girlfriend — And so am I.