Two functions f and g are cofunctions of each other, if f( alpha) = g( beta) where alpha and beta are any complementary angles (that means alpha + beta = 180 degrees).
Examples are sine and cosine, or for example tangent and cotangent.
That means tan(x) = cot(pi/2 - x) for any angle x (here pi/2 radians corresponds to 90 degrees).
Hence
tan(pi/12) = cot(pi/2 - pi/12)
= cot(6pi/12 - pi/12)
= cot(5pi/12)