how to chagne rotation in unity

C#
transform.eulerAngles = new Vector3(0f, 180f, 0f); // rotates 180 degrees
Source

Also in C#: