Pillay's Introduction to Stability Theory has in Chapter 1 the following exercise: if $T$ is stable, and $M \prec N$ are models, then for all $N$-definable $X \subset N$, the set $X \cap M$ is an $M$-definable subset of $M$. He also says that this is just another way of saying that all types are definable.
(The above is not a verbatim statement of the exercise; I might replace it with a verbatim copy later.)
I have been trying to do the exercise by following his hint, but I do not understand the relationship between definable types and definable subsets. The following are my thoughts: If $\phi(x, \bar n)$ is an $L(N)$-formula defining $X$ in $N$, for each $x$ in $X$ we have $\bar m_x$ in $M$ such that $\models \phi(x, \bar m_x)$ by elementarity. Since $\bar m_x$ are, at least prima facie, infinitely many parameters, so we have an infinite set of $L(M)$ formulas, i.e., an incomplete $M$-type. However, this seems useless. The right interpretation of the set of formulas is an infinite disjunction, where as a type usually is an infinite conjunction, so to speak. In addition, even though a type is definable, the defining schema $d$ does not have to be "definable" (in an informal sense), I do not know how $d$ helps us remove those infinite conjunctions or disjunction.
What is the relationship between definable types and definable sets that is useful here?