impedance and resistance in phasors
Why is the R in the solution 8 when the magnitude of the impedance is 10.

The resistance \$R\$ is the real part of the impedance \$Z\$.
In your problem, \$R\$ is 8 because you were told the impedance is \$8+j6\$ and the real part of that is 8.

But why is the I equal to 10 in the equation not 10 cos(-37) when using P=I^2R?

Because the \$R\$ term already contains the \$\cos(-37)\$ factor, since you could express it as \$R=Z\cos\phi\$.
The fundamental equation for real power is \$P_R =\Re{\lbrace VI^\star\rbrace}\$ where the superscript \$\star\$ indicates the complex conjugate.
From this you can obtain either their second equation \$P = VI\cos\phi\$, or, by substituting \$V=ZI\$,
$$P=\Re\lbrace (ZI)(I^\star)\rbrace$$
$$P=\Re\lbrace Z \rbrace\ II^\star$$
$$P= R\ \left|I\right|^2$$