If I understand you correctly, you're struggling with a question about English grammar, not Italian grammar, right?
The answer is fairly simple. In English, you use "a" before words that start with a consonant sound. When the word starts with a vowel sound, you use "an." :) The Italian "un" can translate to either of these, depending on how the English word is spelled! c:
So in Italian you say "un cane", and this translates to "a dog." You also say "un insetto" in Italian, but that translates to "an insect." Notice "an," not "a," because insect starts with a vowel sound. Dog doesn't, so the article "a" is used. Unlike in English, Italian doesn't change the indefinite article before a noun that starts with a vowel sound (at least for masculine words). :)
Does that make sense? I tried to be as clear as possible, though I certainly wasn't concise. XD
Just to clarify: "an" is for starting vowel sounds, "a" is for consonant sounds. I think you might have mixed those up in your reply. :
The correct version is a "a year", because "y" is regarded as a consonant here. It sometimes functions as a vowel, at least in the English language, but despite that I can't think of any time when you would use "an" before a "y". I don't think it ever starts a word as a vowel.
Your question is a pretty good way to mention another confusing thing about the letter y. Some words that are spelled with a vowel as the first letter, like university, use the consonant article "an". Why? Because their pronunciation starts with a consonant sound, "y". University is pronounced "yoo-nuh-vur-si-tee" (or ˌyu nəˈvɜr sɪ ti). Notice how the first letter in the phonetic spelling is "y", a consonant. This is why I've been saying that words starting with consonant SOUNDS use "a" and those starting with vowel SOUNDS use "an". :)
The word comes from the Latin musca, which became mosca in both Spanish and Italian, and mosquito literally means "small fly" in Spanish :) Italians, on the other hand, probably thought that mosquitos were too annoying to be called "little flies", so they decided to call them zanzare (originally zinzale in Late Latin), inspired by that annoying zzz sound that they make.