Theorem : Let $(S, d)$ be a metric subspace of $(M, d),$ and let $X$ be a subset of S. Then $X$ is open in $S$ if, and only if, $$ X=A \cap S $$ for some set $A$ which is open in $M$.
Proof : Assume $A$ is open in $M$ and let $X=A \cap S$. If $x \in X,$ then $x \in A$ so $B_{M}(x , r) \subseteq A$ for some $r>0 .$ Hence $$B_{S}(x , r)=B_{M}(x , r) \cap S \subseteq A \cap S=X$$ so $X$ is open in $S$.
Conversely, assume $X$ is open in $S .$ We will show that $X=A \cap S$ for some open set $A$ in $M .$ For every $x$ in $X$ there is a ball $B_{S}\left(x , r_{x}\right)$ contained in $X$. Now $B_{S}\left(x , r_{x}\right)=B_{M}\left(x ,r_{x}\right) \cap S,$ so if we let $$ A=\bigcup_{x \in X} B_{M}\left(x ,r_{x}\right) $$ then $A$ is open in $M$ and it is easy to verify that $A \cap S=X$.
Here i didn't understand why the line
$$B_{S}(x , r)=B_{M}(x , r) \cap S \subseteq A \cap S=X$$
Means $X$ is open in $S$