A consonant is characterised by the partial blockage of air when spoken, using parts of the mouth, i.e., tongue. A vowel allows for the free flow of air.  So, in certain words, a consonant can become a vowel, particularly the letter Y in words such as fly, cry, and gym.