The relationship between the cotangent and the tangent in trigonometry is something of a red herring here when it comes to cotangent and tangent vectors; the co- there (and in cosine) is an abbreviation of "complement" (etymonline). However, elsewhere the co-/com- means "together" or "counterpart." For instance, complex numbers are the "braiding together" of real and imaginary numbers (aside: the calque "symplectic" was created by Weyl because "complex" had too many uses already).
The "co-" for vectors is related to dualization, the process of taking a vector space and considering, as a vector space, the set of all linear functionals on that vector space. Cotangent vectors (conjugate momenta) are $1$-forms which take tangent vectors as arguments, producing real numbers. Dualization gives a pairing $\langle \alpha, v\rangle = \alpha(v)$ which can be used to associate a finite basis of vectors with a finite basis of covectors, leading to the association between them.
Co- tends to appear when there is a metaphor of dualization. Dualization is a contravariant functor in that linear maps $f:V\to W$ when dualized reverse as in $f^*:W^*\to V^*$, so whenever the "arrows are reversed" in the corresponding diagram in category theory, you can be sure you will find a co- describing it: coproduct, colimit, cohomology, etc.