Definitions
Let $M$ be algebraic variety and let $I$ be the defining ideal of $M$, that is $$I(M) = \{ f \in K[X_1,...,X_n] \mid \forall x \in M : f(x)=0 \}$$ Let $f_1,...,f_m$ be the generators of $I(M)$. Let $$ J = \frac{\partial(f_1,...,f_m)}{\partial(X_1,...,X_n)}$$ be the Jacobian matrix.
A point $x \in M$ in an algebraic variety is called simple if $\mathrm{rk}J(x)=\mathrm{rk}(J)$ where rk is the rank of the $J$. The notation $J(x)$ is the matrix $J$ evaluated in $x \in M$. Clearly, $\mathrm{rk}J(x) \le \mathrm{rk}(J)$.
Let us denoted by $M^{\mathrm{reg}}$ the set of all simple points of $M$. A non-simple point is called regular. A nonsingular variety is a variety without non-simple points.
I want to prove the following:
Any algebraic variety $M$ is the union of finite number of nonintersecting nonsingular subvarieties. That is, $$M = \biguplus_{i=1}^q M_i$$
My attempt
If $M$ is nonsingular then we won. Therefore assume there are singular (non-simple) points in $M$.
Let $M = N_1 \cup ... \cup N_q$ be the decomposition of $M$ into irreducible components. Take one of the $M_i$ to be $M^{\mathrm{reg}}$ which is nonsingular. Now I need to add the rest of the singular points such they each is included in a subvariety in which it is simple. Therefore, I somehow need to take the singular points such that each is contained in a single irreducible component and is simple there (but not in $M$).