From Algebraic Geometry I, by Ulrich Görtz and Torsten Wedhon, p.165:
Exercise $\boldsymbol{6.7}$. Let $k$ be a field, let $X$ be a $k$-scheme, and let $Y_1$ and $Y_2$ be closed subschemes of of $X$ and let $Y_1\cap Y_2$ be their schematic intersection. Let $x\in(Y_1\cap Y_2)(k)$ be a $k$-valued point and assume that $X$, $Y_1$, and $Y_2$ are smooth in $x$ over $k$ of relative dimension $d$, $d-c_1$, and $d-c_2$, respectively. Show that the following assertions are equivalent.
$\ (i)$ $Y_1\cap Y_2$ is smooth at $x$ of relative dimension $d-(c_1+c_2)$.
$(ii)$ $T_xY_1+T_xY_2=T_xX$.
It's easy for affine algebraic variety. However, I have no idea on how to relate tangent spaces with smoothness in general schemes. Could anyone please help me to give a proof?