function with yield WaitForSeconds doesn't run

Hello all,
I’m trying to use yield WaitForSeconds, but I’m not getting good results, my problem is that the routine where yield exists isn’t executed. I’m using C#

Example: (Edited from: Overview: Coroutines & Yield)

public class example : MonoBehaviour {
	void Start()
	{
		Example();
	}
	
    IEnumerator Do() {
        print("Do now");
        yield return new WaitForSeconds(2);
        print("Do 2 seconds later");
    }
    void Example() {
        Do();
        print("This is printed immediately");
    }
	
}

Example() is fully executed (that is OK) but Do() isn’t (no prints). What can I do? Thanks in advance and sorry my bad english.

Coroutines need to be executed differently than normal functions/methods. Make sure to call Do() using StartCoroutine()

StartCoroutine(Do());

Unity StartCoroutine() Reference

See this

and your code must be like this

public class example : MonoBehaviour {
    void Start()
    {
       Example();
    }
 
    IEnumerator Do() {
        print("Do now");
        yield return new WaitForSeconds(2);
        print("Do 2 seconds later");
    }
    void Example() {
        StartCoroutine(Do());
        print("This is printed immediately");
    }
 
}

In C# you have to explicitly use StartCoroutine. Unityscript does not normally require it.