When 'Y' is used to be a vowel and it is preceded by One more vowel, it usually acts for a consonant and it is pronounced much like the 'y' in "yes." such as: "payer"/spend-yay/ (to pay).
By Talking someone's language https://learningfrench.online/grammar/beginner-a1/the-french-alphabet/