Let's consider the triangle ABC shown in the first diagram below. We name the sides with small letters: a, b, and c. We name the angles by the capital letters A, B, and C. Side a pairs with angle A° which are opposite each other. The same with side b and angle B° and side c and angle C°.
We can use the cosine rule when we know the length of two sides and the angle opposite the side that is unknown. For example, referring to the second diagram, we know the length of side a and side b and we are looking for the length of side c. We also know the angle that is located on the opposite of side c, then to solve this we can use the cosine rule
c² = a² + b² - 2ab(cos(C°))
The third diagram shows a scenario when sine rule can be used. Say we need the length of the side c. We know the length of side a, the size of angle A° and angle C° then we can use the sine rule
We can also use sine rule if we know length of side b and the size of angle B° instead of side a and angle A°