Make Script Wait For Certain Time

Hi, what I´m trying to do is that the camera rotates for a certain time and then it goes back to its original position, how can I do that? I tried to use the code WaitForSeconds, but it gives me an error(The code with the 2 slashes).

Rotaion Code:

else if(twists > 0){
				transform.Find("Main Camera").Rotate(0,0,180);
				twists -= 1;
				GUIManager.SetPowers(twists);
				//yield return new WaitForSeconds(10);
				transform.Find("Main Camera").Rotate(0,0,180);
			}

It looks like you’re using C# by the syntax. If that is the case then your method needs to return the IEnumerator type.

IEnumerator Coroutine(float waitTime)
{
    // do stuff before waitTime

    if (waitTime > 0)
        yield return new WaitForSeconds(waitTime);

    // do stuff after waitTime
}

To start a coroutine you need to use a particular method, not just call the method name; like so:

void Awake()
{
    StartCoroutine(Coroutine(1.5f));
}