Repeating the question
Why $(x-\frac{1}{2})^2 + y^2 = \frac{1}{4}$ is equivalent to the function $r = \cos(t)$ in polar coordinates?
The author's solution was
Unfortunately, I don't quite get "a bit" of algebra he is talking about.
So far what I did was
$$\begin{align}(x-\frac{1}{2})^2 + y^2 = \frac{1}{4} &\implies x^2 - x + \frac{1}{4} +y^2 = \frac{1}{4} \\ &\implies x^2 - x+y^2 = 0 \\ & \implies \cos (\theta)^2 r^2 - \cos (\theta) r + \sin^2 (\theta) r^2 =0 \\ & \implies r^2 - \cos \theta r = 0 \end{align}$$
The only possibility (that I see) to obtain the desired result is to divide both sides by $r$ and rearrange. But in this case we need to suppose that $r ≠ 0$. Are we allowed to? And why in his solution he switched variable $\theta$ with $t$?

From your last you can go to $r(r-cos \theta)=0$. You can observe that $r=0$ corresponds to $x=0,y=0$ and is a solution for the original equation. Then you can say that you are going to look for other solutions, where $r \neq 0$, so you can divide by it and get $r=\cos \theta.$ I don't know why the author switched to $t$.