Note: $\frac{d}{dx}$ and $'$ denote the derivative.
$$y=\sin^2\left(\frac{x}{2}\right)=\left(\sin\frac{x}{2}\right)^2$$
I will refer to $2$ as my power, $\sin$ as my expression, and $x/2$ as my angle. Basically, we are using chain rule twice.
Chain rule says we'll get power times expression to power minus one times derivative of expression times derivative of expression. Generally this:
$$2(\exp)^1(\exp')$$
For your problem
$$y'=2\left(\sin\frac{x}{2}\right)^1\cdot\left(\frac{d}{dx}\sin\left(\frac{x}{2}\right)\right)$$
Now, for taking the derivative of $\sin\frac{x}{2}$, we use chain rule again. Generally, it's derivative of angle times derivative of expression of angle, or this:
$$\text{ang}'\cdot \exp'(\text{ang})$$
For you
$$\frac{d}{dx}\sin\frac{x}{2}=\frac{1}{2}\cos\frac{x}{2}$$
Putting it all together:
$$y'=2\left(\sin\frac{x}{2}\right)^1\left(\frac{1}{2}\cos\frac{x}{2}\right)$$
Cancelling $2$ and $1/2$:
$$y'=\sin\frac{x}{2}\cdot\cos\frac{x}{2}$$
Using double ange formula for sine:
$$y'=\frac{1}{2}\sin x$$