2 dimensional Smooth manifold of $ℝ^3$ From this post , 
In attempt solve to this problem, I followed Yves Daoust's approach for parametise the torus as followed: 

A circle of radius $a$ centered at $(b,0)$ in the plane $xz$ has the
  parametric equation
$$x=a\cos(\theta)+b,z=a\sin(\theta),$$ with $\theta$ in the range
  $[0,2\pi]$ for a full circle.
Now you rotate the plane $xz$ around $z$ by $x\leftarrow
> x\cos(\phi),y\leftarrow x\sin(\phi)$,  with $\phi$ in the range
  $[0,2\pi]$ for a full turn,
$$x=(a\cos(\theta)+b)\cos(\phi),\\ y=(a\cos(\theta)+b)\sin(\phi),\\
z=a\sin(\theta).$$
If you freeze $\theta$, you get a circle in a plane parallel to $xy$,
  of the form:
$$x=r\cos(\phi),y=r\sin(\phi).$$

I was trying to use Preimage theorem to prove the problem, however, I couldn't get far so when I went back to the original post and read Ted Shifrin's comment:

to apply the regular value theorem, you need a smooth function, so you
  do need to delete the z-axis from $ℝ^3$ before applying the theorem

I was wondering what does Ted mean by deleting the z-axis? I can't seem to grasp how it works. Much appreciated for any help

Two comments: Once you have the parametrization, you could use it to prove that the torus is a $2$-dimensional manifold.
EDIT: The main idea is to check that the mapping $g\colon (0,2\pi)\times (0,2\pi)\to\Bbb R^3$ has rank $2$ everywhere. It follows that, restricting to its image (the torus), the inverse mapping gives a coordinate chart on most of the torus. You can use periodicity of the trig functions to take care of the missing points. If you know about quotient topology, you get an induced homeomorphism from $[0,2\pi]\times [0,2\pi]\big/\big((0,\phi)\sim (2\pi,\phi) \text{ and } (\theta,0)\sim (\theta,2\pi)\big)$ to the torus in $\Bbb R^3$.
With regard to my comment about the $z$-axis, my point was that the function 
$$f\colon\Bbb R^3\to\Bbb R\,, \quad f(x,y,z) = \big(\sqrt{x^2+y^2}-b\big)^2 + z^2$$
is only smooth away from $x^2+y^2=0$, i.e., the $z$-axis. To apply the regular value theorem, you have to start with a smooth function and then check that your value — in this case, $a^2$ — is a regular value. So I suggested deleting the $z$-axis and considering $f$ with domain $\Bbb R^3-\{x=y=0\}$; now $f$ is smooth. :)
