Hello Aanylah! This is a perfect example of a special triangle problem known as the "1-1-sqrt(2)", where there is a right triangle with two 45-degree angle measures, and "sqrt(2)" is the hypotenuse. Technically, you can always use the Pythagorean Theorem to get the answer (a2+b2=c2), but it's faster to remember this particular triangle's measurements.
Consider a triangle with sides that match your square, in this case 12cm. Since you have a square, you know that this is a right-triangle. Having two sides with equal lengths means that the angles of those must measure equally... 45-degrees.
If you apply the 1-1-sqrt(2) rule, then you can treat this triangle as a scaled version of that. This gives you a triangle measuring "1x(12) - 1x(12) - sqrt(2) x (12)". This means your hypotenuse (the diagonal of the square) is equal to 12xsqrt(2), or approximately 16.97 cm.