There are two ways known to me to define the cotangent bundle on a smooth manifold $X$:
Either as the dual bundle of the tangent bundle (see any textbook on differential geometry) or (by abuse of notation, confusing vector bundles and locally free sheaves) as the pullback of $I/I^2$ along the diagonal morphism $\Delta: X\rightarrow X\times X$, where $I$ is the sheaf of smooth functions on $X\times X$ vanishing on the image of $\Delta$ (see for instance Wikipedia). The former is very intuitive and geometric, the latter quite nicely carries over to similiar situations (e.g. cotangent spaces of schemes, complex analytic spaces etc.).
However I was not able to figure out, nor to find an explanation in the literature, why those two construction give the same object.
Could someone give a reference or an explanation?