The letter Y at the front of a word stands for the Y-consonant-sound (IPA: /j/). In Old and Middle English there used to be a separate letter for the Y-consonant-sound Ȝ, known as yogh. This letter was mostly dropped during the time the Norman French ruled England. They used the letter Y (and sometimes GH) to replace the English Ȝ.
When spelled with the letter Y, the Y-consonant-sound is normally found at the beginning of words. Most words beginning with Y are from Old English, for example: yard, yarn, yawn, year, yearn, yeast, yell, yellow, yelp, yes, yesterday, yet, yield, yoke, yonder, yolk, you, your, young and youth. There are a few exceptions borrowed from other languages, including yam (Portuguese-African), yoga (Hindi) and yoghurt (Turkish). A vowel normally follows the consonant Y.
Sometimes in the middle of a word the Y-consonant-sound is also written with a letter I. This pronunciation usually occurs after a consonant sound with a preceding vowel. For example: billiards, billion, brilliant, civilian, companion, familiar, junior, million, onion, peculiar, senior and union. These words were all imported into English from French or Latin during the Norman period.
The Y-consonant-sound is also spelt EU. This spelling is most commonly found in the old EU- prefix. The prefix is a form of the Greek EUS- meaning good/well/right/happy. (The opposite is DYS-, as in dystopia, dyslexia and dysentery.) EU- prefix words include: eucalyptus, euphemism, euphoria and euthanasia. (The word Europe was derived from the name of princess Europa, who was raped by Zeus in Greek mythology.)
In conclusion, the Y-consonant-sound, when spelt with a letter Y, is normally before a vowel and usually at the beginning of a word. It is part of the long U sound in its various spellings. This sound is also sometimes spelt I in the middle of a word or EU at the beginning. This sound only has a limited association with its letter.