Using a diagram
If one third of the flock are goats, then two thirds must be sheep.
There are 12 more sheep than goats:
So altogether there are 12 + 12 + 12 = 36 animals.
Using fractions and words
If one third of the flock are goats, then two thirds must be sheep.
If there are 12 more sheep than goats: difference between one third and two thirds of the flock must be 12 animals.
So one third of the flock is 12 animals. So the whole flock is 12 $\times$ 3 = 36 animals.
Using proportion and words
If one third of the flock are goats, then two thirds must be sheep, so there must be twice as many sheep as goats.
There are 12 more sheep than goats, so doubling the number of goats is the same as adding 12. So there must be 12 goats.
That means there must be 24 sheep, so there are 36 animals altogether.
Using fractions and algebra
Suppose there are $A$ animals in the flock. Then there are $\frac{1}{3}A$ goats in the flock, so there must be $\frac{2}{3}A$ sheep.
There are 12 more sheep than goats, so $\frac{1}{3}A+12=\frac{2}{3}A\Rightarrow12=\frac{2}{3}A-\frac{1}{3}A=\frac{1}{3}A$.
So $\frac{1}{3}A=12\Rightarrow A=36$.
Using proportion and algebra
If one third of the flock are goats, then two thirds must be sheep, so there must be twice as many sheep as goats. So $s=2g$, where $g$ represents the number of goats in the flock and $s$ represents the number of sheep in the flock.
There are $12$ more sheep than goats, so $s=g+12$.
But if $s=2g$ and $s=g+12$, then $2g=g+12\Rightarrow g=12$.
Since a third of the flock are goats, there are $3g=3\times12=36$ animals in the flock.