Many have been confused about the proof for theorem 2.43 in baby rudin, and I didn't find it satisfying when I searched it in MSE.Here may serve as a simple explanation:
Two facts:
The initial thought is that for each $x_n$, we shall construct a set $V_n$ which does not contain $x_n$ (you can finetune them lately to get more properties).
A core fact is that for any two points $x_1$ and $x_2$ in $P$, and in any neiborhood of $x_1$, there exists a point $p$ which is diffrent from $x_2$ (no matter $x_1$ is equal to $x_2$ or not), since $P$ is a perfect set (just discuss the radius of this neighbor and compare it to $d(x_1,x_2)$).
The construction process:
For $x_1$, choose any neighbor of it, in this neighbor, find a $p_1$ which is different from $x_1$ and $x_2$, make sure a neighbor of $p_1$, named as $V_1$, doesn't contain $x_1$, this is easy to achieve.
In $V_1$, find a $p_2$ which is different from $x_2$, so we can find a $V_2$, as a neighbor of $p_2$, which does not contain $x_2$. Make sure this $V_2$ is small enough so that $V_2\subset V_1$.
Still, in $V_2$ find a $p_3$ which is different from $x_3$, and find a neighbor of $p_3$ which does not contain $x_3$ and small enough thus $V_3\subset V_2$...
By this process, we can be clear that for any $x_n$, after finite steps a $V_n$ which does not contain it can be constructed, and $V_n\subset V_{n-1}$.
Now let's substitute every $V_n$ by $\overline{V_n}$ , we just make sure every $V_n$ is small enough so this substitution won't destroy the properties we got above.
The following steps are as what Rudin gave.