In a right rectangle, we have:
[tex]\sin \alpha=\frac{opposite}{hypotenuse}[/tex][tex]\cos \alpha=\frac{\text{adjacent}}{hypotenuse}[/tex]For your exercice, hypotenuse=12
The exercise also inform the angle 60°, then:
[tex]\sin \text{ 60}=\frac{\text{opposite}}{\text{hypotenuse}}=\frac{b}{12}[/tex][tex]\cos 60=\frac{adjacent}{\text{hypotenuse}}=\frac{a}{12}[/tex]