As per the definition of direction cosines, the cosine values of the angles formed by the directed line with the x-axis, y-axis and z-axis.
Here we consider the directed line to be the z-axis.
So from the below figure, we can say,
α = the angle formed by the z-axis with x-axis = 90°
β = the angle formed by the z-axis with y-axis = 90°
γ = the angle formed by the x-axis with y-axis = 0°
Therefore,
cos α = cos 90° = 0
cos β = cos 90° = 0
cos γ = cos 0° = 1
Hence the direction cosines of y-axis are 0, 0, 1.