how to yield in C#

Okay I would like to do is make a swinging sword swinging script and limit how fast you can do this. I know how to use yield in java but I’me having trouble translating to c#.
I’ve tried to use bool

IEnumerator Up() {
canswing=false;
yield return new WaitForSeconds(3);
canswing=true;
}

that gave me errors so I separated true and false with two different functions I have no way of testing that out because Its not even calling on the IEnumerator function how would I call upon it through Update at the click of a button

this is my current script

public bool canswing = true;
IEnumerator Up() {
haswung();
yield return new WaitForSeconds(3);
Return();
}
void Update () {

if(canswing){
if(Input.GetMouseButtonDown(0)){
animation.Play("swing");
Up();
}}
}
void haswung(){
canswing=false;
}
void Return(){
canswing=true;
}

In C# you must call a coroutine with StartCoroutine:

void Update() {

  if(canswing){
    if(Input.GetMouseButtonDown(0)){
      animation.Play("swing");
      StartCoroutine(Up());
    }
  }
}

bool canswing = true;

IEnumerator Up() {
  canswing=false;
  yield return new WaitForSeconds(3);
  canswing=true;
}

Another hint: in JS you simply use yield SomeCoroutine(); to chain a coroutine to another one, but in C# you must use yield return StartCoroutine(SomeCoroutine());