$\def\A{\mathbb{A}}
\def\ord{\operatorname{ord}}
\def\sO{\mathcal{O}}$The following discussion will be strictly classical.
Let $A$ be any ring. Given a polynomial $f\in A[t]$, we denote $\ord f$ to the vanishing order of $f$ at $t=0$, i.e., it is the maximum integer $e$ such that $t^e$ divides $f$. If $A$ is a domain, then $\ord$ is a valuation of the ring $A[t]$, i.e., it satisfies
- $\ord f=+\infty\Leftrightarrow f=0$,
- $\ord (fg)=\ord f+\ord g$,
- $\ord (f+g)\geq\min\{\ord f,\ord g\}$.
From the axioms, it follows that $\ord\left(\sum_{i=1}^nf_i\right)\geq\underset{i=1,\dots,n}{\min}\ord f_i$ (use induction in $n$; Bourbaki, Commutative Algebra, Ch. VI, § 3.1, Proposition 1).
Let $k$ be an algebraically closed field. Let $X\subset\A_k^n$ be an algebraic subset (i.e., $X=\mathscr{V}(S)$ for some set $S\subset k[x_1,\dots,x_n]$). Suppose $\mathscr{I}(X)=(f_1,\dots,f_r)$ and let $a=(a_1,\dots,a_n)$ be a point in $X$. Let $\vec{v}$ be a vector in $k^n$. Then $\hat{f}_i(t)=f_i(a+t\vec{v})$ are polynomials in $t$ vanishing at $t=0$. Denote $l=\{a+\lambda\vec{v}\mid\lambda\in k\}\subset\mathbb{A}^n_k$ to the line containing $a$ and with direction $\vec{v}$.
Definition 1. The multiplicity of intersection of $X$ and $l$ at $a$ is $\mu_a(X,l)=\mu_a(l,X)=\underset{i=1,\dots,r}{\min}\ord\hat{f}_i\geq 1$.
The multiplicity $\mu_a(X,l)$ does not depend on $\vec{v}$ and does only depend on $l$, i.e., $\ord_tf_i(a+t\vec{v})=\ord_tf_i(a+t\lambda\vec{v})$ for $\lambda\in k\setminus\{0\}$, since if $g\in A[t]$ and $A$ is a domain, then $\ord g(t)=\ord g(ct)$, $c\in A\setminus\{0\}$.
Lemma 2. The multiplicity of intersection $\mu_a(X,l)$ does not depend on the choice of generators and only depends on $\mathscr{I}(X)$.
Proof. Suppose $\mathscr{I}(X)=(f_1,\dots,f_r)=(g_1,\dots,g_s)$. Then $g_i=\sum_{j=1}^rh_{ij}f_j$, for some $h_{ij}\in k[x_1,\dots,x_n]$. Thus $g_i(a+t\vec{v})=\sum_{j=1}^rh_{ij}f_j|_{a+t\vec{v}}$ and
\begin{align*}
\operatorname{ord}_tg_i(a+t\vec{v})
&\geq\min_{j=1,\dots,r}\operatorname{ord}_t(h_{ij}f_j|_{a+t\vec{v}})\\
&=\min_{j=1,\dots,r}\left[\operatorname{ord}_t h_{ij}(a+t\vec{v})+ \operatorname{ord}_t f_j(a+t\vec{v})\right]\\
&\geq\min_{j=1,\dots,r}\operatorname{ord}_t h_{ij}(a+t\vec{v})+ \min_{j=1,\dots,r}\operatorname{ord}_t f_j(a+t\vec{v})\\
&\geq\min_{j=1,\dots,r}\operatorname{ord}_t f_j(a+t\vec{v}).
\end{align*}
Therefore,
$\displaystyle
\min_{i=1,\dots,s}\operatorname{ord}_t g_i(a+t\vec{v})
\geq\min_{j=1,\dots,r}\operatorname{ord}_t f_j(a+t\vec{v}).
$
Interchanging the role of the $g_i$'s and the $f_j$'s, one obtains the converse inequality. $\square$
Remarks 4.
The previous proof shows that $\displaystyle\mu_a(X,l)=\min_{f\in\mathscr{I}(X)}\ord_tf(a+t\vec{v})$.
$\mu_a(X,l)=+\infty$ if and only if $l\subset X$.
Definition 4.
The line $l$ is said to be tangent to $X$ at $a$ if $\mu_a(X,l)\geq 2$.
The tangent space of $X$ at $a$, denoted $T_aX$, is the set of vectors $\vec{v}\subset k^n$ such that the line $a+\lambda\vec{v}$ is tangent to $X$ at $a$.
Proposition 5. $T_aX$ is a $k$-vector subspace of $k^n$.
Proof. Let $\vec{v}\in k^n$. If $\mathscr{I}(X)=(f_1,\dots,f_r)$, then $f_i(a+t\vec{v})$ vanish at $t=0$. In general, if $A$ is any ring and $g\in A[t]$ vanishes at $t=0$, then $\ord g\geq 2$ if and only if $\frac{dg}{dt}|_{t=0}$ vanishes. Thus $\mu_a(l,X)\geq 2$ if and only if
$$
\tag{1}\label{cond}
\left.\frac{df_i}{dt}(a+t\vec{v})\right|_{t=0}=0,\quad\forall i=1,\dots,r.
$$
By the algebraic multivariate chain rule,
$$
\tag{2}\label{equiv}
\vec{v}\in T_aX\Leftrightarrow\sum_{s=1}^rv_s\partial_sf_i(a)=\vec{v}\cdot\nabla f_i(a)=0,\quad\forall i=1,\dots,r,
$$
where $\nabla f_i(a):=(\partial_1f_i(a),\dots,\partial_nf_i(a))\in k^n$.
Denote $Df(a):k^n\to k^r$ to the linear transformation given by the matrix $\begin{pmatrix}\nabla f_1(a)\\\vdots\\\nabla f_r(a)\end{pmatrix}$. Then $T_aX=\ker (Df(a))$ is a linear subspace of $k^n$. $\square$
Remarks 6.
By Remark 4.1, this proof actually shows
$$
\tag{3}\label{ts}
T_aX=\{\vec{v}\in k^n\mid \vec{v}\cdot\nabla f(a)=0,\;\forall f\in\mathscr{I}(X)\}.
$$
The polynomial ring $R=k[x_1,\dots,x_n]$ has a canonical graded ring structure $R=\bigoplus_{i\geq 0}R_i(0)$, where $R_i(0)$ is the zero polynomial and the homogeneous polynomials of degree $i$. Pushingforward this graded structure along the automorphism $f\mapsto f(x-a)$ of $A$ gives a graded structure $R=\bigoplus_{i\geq 0}R_i(a)$, where $R_i(a)=\{\lambda(x_1-a_1)^{r_1}\cdots(x_n-a_n)^{r_n}\mid\lambda\in k,r_1+\cdots+r_n=i\}$.
We will finish this disquisition on the tangent space by writing $T_aX$ in two interesting alternative ways; these are \eqref{ats} and \eqref{tss}.
Given $f\in k[x_1,\dots,x_n]$, denote $f^{(1a)}$ to the homogeneous component of degree $1$ in the graded structure $\bigoplus_{i\geq 0} R_i(a)$. Then $f^{(1a)}=(x-a)\cdot\nabla f(a)$, where $x=(x_1,\dots,x_n)$ is the vector of indeterminates. Then \eqref{equiv} and \eqref{ts} read
$$
T_aX=\mathscr{V}(f_i^{(1a)}(x+a)\mid i=1,\dots,r)=\mathscr{V}(f^{(1a)}(x+a)\mid f\in\mathscr{I}(X)).
$$
Equivalently,
$$
\tag{4}\label{ats}
T_aX+a=\mathscr{V}(f_i^{(1a)}\mid i=1,\dots,r)=\mathscr{V}(f^{(1a)}\mid f\in\mathscr{I}(X)).
$$
Define the directional derivative at $a$ in the direction $\vec{v}\in k^n$ to be the composite
$$
\tag{5}\label{dd}
\partial_{\vec{v}}:k[x_1,\dots,x_n]
\xrightarrow{(-)|_{a+t\vec{v}}}k[t]
\xrightarrow{\frac{d}{dt}}k[t]
\xrightarrow{(-)|_{t=0}}k
$$
Then $\partial_{\vec{v}}f=\vec{v}\cdot\nabla f(a)$. Moreover, \eqref{dd} is a $k$-derivation (where $k$ has a $k[x_1,\dots,x_n]$-module structure coming from valuation at $(x_1,\dots,x_n)=a$), for the middle morphism in \eqref{dd} is a $k$-derivation and the left and right morphisms are $k$-algebra homomorphisms. By the universal property of the localization with respect to derivations [ref] and since $\mathcal{O}_{\mathbb{A}^n_k,a}=k[x_1,\dots,x_n]_{\mathfrak{m}_p}$, the directional derivative induces a $k$-derivation $\partial_{\vec{v}}:\mathcal{O}_{\mathbb{A}^n_k,a}\to k$ such that the diagram
commutes. Let $\mathscr{I}_{X,a}\subset\mathcal{O}_{\mathbb{A}^n_k,a}$ be the ideal of germs with a representative that vanish at $X$. Then
\begin{align*}
T_aX
&=\{\vec{v}\in k^n\mid\partial_{\vec{v}}f=0,
\;\forall f\in\mathscr{I}(X)\}\\
&=\{\vec{v}\in k^n\mid\partial_{\vec{v}}f=0,
\;\forall f\in\mathscr{I}_{X,a}\}.\tag{6}\label{tss}
\end{align*}
The first equality is identity \eqref{ts}. To see the second equality, note that $\partial_{\vec{v}}(\mathscr{I}_{X,a})=0\Rightarrow \partial_{\vec{v}}(\mathscr{I}(X))=0$ by commutativity of the diagram above. Conversely, suppose $\vec{v}\in k^n$ satisfies $\partial_{\vec{v}}f=0$ for all $f\in\mathscr{I}(X)$. Let $h\in\mathscr{I}_{X,a}$. We may assume $h=f/g$, where $f\in\mathscr{I}(X)$. Then $\displaystyle\partial_{\vec{v}}\left(\frac{f}{g}\right)=\frac{g(a)\partial_{\vec{v}}f-f(a)\partial_{\vec{v}}g}{g(a)^2}=\frac{g(a)\partial_{\vec{v}}f}{g(a)^2}=0$.
Therefore, if $\vec{v}\in T_aX$, then $\partial_{\vec{v}}:\sO_{\A^n_k,a}\to k$ induces a $k$-derivation $\partial_{\vec{v}}:\sO_{X,a}=\sO_{\A^n_k,a}/\mathscr{I}_{X,a}\to k$.
References
A. Rojas León, Notas y ejercicios de Geometría Algebraica (archived in the Wayback Machine)