If you have a weighted homogeneous polynomial $f(z_1,z_2)$ then that means there's a $\mathbb{C}^\times$ action which preserves both the curve $C=\{f=0\}$ and its complement. Take a small sphere $S$ centred at the origin which is transverse to the orbits of this group action. Its intersection with the curve is a link $L$ (not necessarily a knot); these knots and links are examples of algebraic links. They are well-studied and two of the classic references are Milnor "Singular points of complex hypersurfaces" (Chapter 10) and Brieskorn--Knoerrer "Plane algebraic curves" (Chapter 8.5). The subset $S\setminus L\subset\mathbb{C}^2\setminus C$ is a deformation retract: you can construct the deformation retraction using the scaling action of $\exp(\mathbb{R})\subset\mathbb{C}^\times$ to move points into $S$.
The simplest example is the curve $\{z_1=0\}$, which gives the unknot in $S^3$. If you take $\{z_1z_2=0\}$ then you get the 2-component Hopf link. You can see this by stereographically projecting the 3-sphere $|z_1|^2+|z_2|^2=1$ from the point $(0,i)$. The intersection of the curve with the sphere consists of the unit circles in the $z_1$ and $z_2$ planes, which project respectively to the unit circle in the $xy$-plane and the $z$-axis. When you project instead from a nearby point that isn't on the $z_2$-axis, this vertical line becomes a very big circle that links with the first one.
It's a bit harder to see why you get the trefoil from $z_1^2=z_2^3$. More generally $z_1^p=z_2^q$ gives you the $(p,q)$-torus link. Brieskorn and Knoerrer give a good explanation of how to figure out what you get. More generally, an algebraic link is obtained by intersecting a small sphere with a curve, but the curve doesn't have to be weighted homogeneous. In that case, you get an "iterated torus knot": you take a torus knot and thicken it, then stick another torus knot on the boundary of the thickening, etc. Which torus knots you use depends on the Newton-Puiseux expansion of $f$.