Dr Ahmed's answer is good, but there's an additional detail I think you might want to heed for future problems.
Usually, when we take the square root of a squared expression, we have $\sqrt{x^2}=|x|$. So in the third step of Dr Ahmed's solution we should have $\int_0^\pi \sqrt{\sin^2(x)} dx=\int_0^\pi |\sin(x)| dx$.
Since $\sin(x)$ is positive for all $x\in[0,\pi]$, we can remove the absolute value bars and just have $$\int_0^\pi |\sin(x)|dx=\int_0^\pi \sin(x) dx=2.$$
If the integral's lower bound covered a region where $\sin(x)$ could yield negative values, then we'd need to split the integral appropriately. For instance:
$$\int_{-\pi}^{\pi}|\sin(x)|=\int_{-\pi}^{0}-\sin(x)dx+\int_{0}^{\pi}\sin(x)dx.$$