If a vector is given by a pair, for instance (2,5), then the horizontal component is 2 and the vertical component of the vector is 5

If the vector is given as a line segment in x, y plane, then the horizontal component is given by the length of the segment multiplied by the cosine of the angle the segment makes with the x axis. Similarly, the vertical component is given by the segment length multiplied by the sine of the angle the segment make with the x axis.