Answer
$\dfrac{-2p+(p-2)\sqrt{p}+8}{p-2}$
Work Step by Step
Rationlize the denominator by multiplying $\sqrt{p}-2$ to both the numerator and the denominator to obtain:
\begin{align*}
\frac{p-4}{\sqrt p +2}&=\frac{(p-4)(\sqrt{p}-2)}{(\sqrt p +2)(\sqrt{p}-2)}\\
\\&=\frac{(p-4)(\sqrt p-2)}{(\sqrt p +2)(\sqrt p-2)}\\
\\&=\frac{p(\sqrt{p}-2)-4(\sqrt{p}-2)}{(\sqrt{p})^2-2^2} &\text{(Distribute, use the rule }(a-b)(a+b)=a^2-b^2.)\\
\\&=\frac{p\sqrt{p}-2p-4\sqrt{p}+8}{p-4}\\
\\&=\frac{(p\sqrt{p}-2\sqrt{p})-2p+8}{p-2}\\
\\&=\frac{-2p+(p-2)\sqrt{p}+8}{p-2}
\end{align*}