The letter Y can be a vowel or a consonant, and it can have 5 different sounds.
It can have the long EEE sound as in HAPPY.
It can have the long I sound as in TRY.
It can have the schwa sound as in VINYL.
It can ve silent as in DAY.
It can have the J sound as in YELLOW.
If it comes at the beginning of a word it always sounds as it does in the word YES.
If it comes at the end of a word, without a vowel before it, it sounds like the E in FREE, such as words like STORY, CRAZY and ANGRY.
For words that end with AY, the Y is always silent, and the A sounds like its name. So, DAY, PAY, MAY, STAY all have the same sound as their ending.
The same happens with words that end in EY, so the Y is silent and the E sound like its name. The words KEY, MONKEY, and MONEY all have endings which sound the same.
There are very few words that end in IY.
If you start saying the sound of O and slowly change to E, you get the sound OI. This is the sound of all words which end in OY, such as BOY, TOY, and JOY.
There are not many words that end in UY. The 2 most common are BUY and GUY. If you start with the sound of A, as in FAR and change to E and in FREE, you get the sound AE, and this is the sound of BUY and GUY.