Another answer to this question, based on ideas from my answer here. I will write a trefoil knot as the transverse intersection of two smooth polynomial surfaces. I will also draw pictures!

Here is the basic idea. Let $S^3$ be the sphere $|z_1|^2 + |z_2|^2 = 2$ inside $\mathbb{C}^2$. I'll write each coordinate $z_j$ as $x_j+i y_j$. The trefoil knot $K$ is given by the equation $z_1^3 = z_2^2$ in $S^2$. Taking real and imaginary parts, we get
$$x_1^3 - 3 x_1^2 y_1 = x_2^2 - y_2^2 \qquad 3 x_1^2 y_1 - y_1^3 = 2 x_2 y_2. \qquad (1)$$
I compute in my linked answer that these give smooth, transverse, surfaces in $S^3$.

That's $S^3$, but the OP asked for $\mathbb{R}^3$. To this end, we can remove a point from $S^3$. Since the OP wants a closed knot, not one that goes off to infinity, we should remove a point not on $K$. It is also good to remove a point where $z_1^3-z_2^2$ is neither purely real nor purely imaginary, so the two
surfaces in $(1)$ will stay compact. I choose the point $(1+i, 0)$.

Stereographic projection away from the point $(1+i, 0)$ is given by the formula
$$(u,v,w) \ = \ \frac{1}{2-x_1-y_1} (x_1-y_1, x_2, y_2) \qquad (2).$$
Composing $(2)$ with the parametrization $(e^{2 i t}, e^{3 i t})$ of $K$, we get a knot in $\mathbb{R}^3$ parametrized as
$$\left( \frac{\cos (2 t) - \sin(2 t)}{2-\sin (2 t)-\cos (2 t)},\
\frac{\cos (3 t)}{2-\sin (2 t)-\cos (2 t)},\
\frac{\sin (3 t)}{2-\sin (2 t)-\cos(2 t)}\right).$$

To get equations for the surfaces in $(1)$, we need to have the inverse of $(2)$. That's easy to compute; the inverse map is
$$(x_1, y_1, x_2, y_2) = $$
$$\frac{1}{u^2+2 v^2+2 w^2+1} \left( u^2+2 u+2 v^2+2 w^2-1,\
u^2-2 u+2 v^2+2 w^2-1,\
4v,\ 4 w \right). $$
Plugging this into $(1)$ and putting everything over a common denominator, we get the equations
$$2 + 12 u - 30 u^2 - 40 u^3 + 30 u^4 + 12 u^5 - 2 u^6 - 28 v^2 -
48 u v^2 + 56 u^2 v^2 + 48 u^3 v^2 - 12 u^4 v^2 - 8 v^4 + 48 u v^4 -
24 u^2 v^4 - 16 v^6 + 4 w^2 - 48 u w^2 + 88 u^2 w^2 + 48 u^3 w^2 -
12 u^4 w^2 + 48 v^2 w^2 + 96 u v^2 w^2 - 48 u^2 v^2 w^2 -
48 v^4 w^2 + 56 w^4 + 48 u w^4 - 24 u^2 w^4 - 48 v^2 w^4 - 16 w^6 =$$
$$-2 + 12 u + 30 u^2 - 40 u^3 - 30 u^4 + 12 u^5 + 2 u^6 + 12 v^2 -
48 u v^2 - 72 u^2 v^2 + 48 u^3 v^2 + 12 u^4 v^2 - 24 v^4 +
48 u v^4 + 24 u^2 v^4 + 16 v^6 - 32 v w - 32 u^2 v w - 64 v^3 w +
12 w^2 - 48 u w^2 - 72 u^2 w^2 + 48 u^3 w^2 + 12 u^4 w^2 -
48 v^2 w^2 + 96 u v^2 w^2 + 48 u^2 v^2 w^2 + 48 v^4 w^2 - 64 v w^3 -
24 w^4 + 48 u w^4 + 24 u^2 w^4 + 48 v^2 w^4 + 16 w^6=0$$
for $K$.

Here is the first equation, together with the knot. (Apologies for the gaps in the knot; I spent a while fighting with Mathematica and I want to go to bed. And thanks to this answer for getting me this far!)

And here are the two surfaces together. It's hard for me to actually see this, but it is two genus two surfaces, meeting along the knot.

As a final note, I spent a long time trying to get $K$ as the intersection of a genus $1$ surface with something, since $K$ is, after all, a torus knot. It took me a while to understand why I was failing: If $K$ is to be the transverse intersection of $T$ and $\{ f=0 \}$, then I want $f$ restricted to $T$ to be positive on one side of $K$ and negative on the other. But, if I embed $K$ into a torus $T$, then $K$ will not disconnect $T$, so this is impossible. The knot $K$ does disconnect the genus $2$ surfaces in the pictures, which is why I succeed.