Wait For Seconds c#

i know that was asked a lot of times from other users, but i still can use wait for seconds on c#,

i have this:

if(Input.GetKeyDown(KeyCode.Q)) {
    if(GetComponentInChildren<WeaponBase>().isAiming) {
         GetComponentInChildren<WeaponBase>().AimOut();
         yield return new WaitForSeconds(3.0f);
         SwitchWeapon();
    }
    else {
         SwitchWeapon();
    }
}

i know that i need IEnumerator but i can’t put it on the code. someone can help me ?

bool canSwitch = false;
bool waitActive = false; //so wait function wouldn’t be called many times per frame

IEnumerator Wait(){
    waitActive = true;
    yield return new WaitForSeconds (3.0f);
    canSwitch = true;
    waitActive = false;
}


if(Input.GetKeyDown(KeyCode.Q)) {
    if(GetComponentInChildren<WeaponBase>().isAiming) {
        GetComponentInChildren<WeaponBase>().AimOut();
        if(!waitActive){
            StartCoroutine(Wait());   
        }
        if(canSwitch){
            SwitchWeapon();
            canSwitch = false;
        }
    else {
        SwitchWeapon();
    }
}

I wanted to wait x Seconds in the Update() before continuing.
So if someone, like me, searched this / needs this and is now here:

private float timer = 0;

private float timerMax = 0;

void Update ()
{
   text += "Allow yourself to see what you don’t allow yourself to see.";

   if(!Waited(3)) return;

   text += "

Press any key!";
}

    private bool Waited(float seconds)
    {
        timerMax = seconds;

        timer += Time.deltaTime;

        if (timer >= timerMax)
        {
            return true; //max reached - waited x - seconds
        }

        return false;
    }

I wanted to wait x Seconds in the Update() before continuing. So you cannot use the yield there (don’t want to start a coroutine every frame right?)

So if someone, like me, searched this / needs this in and for the Update():

private float timer = 0;

private float timerMax = 0;

void Update ()
{
   text += "Allow yourself to see what you don’t allow yourself to see.";

   if(!Waited(3)) return;

   text += "

Press any key!";
}

private bool Waited(float seconds)
{
    timerMax = seconds;

    timer += Time.deltaTime;

    if (timer >= timerMax)
    {
        return true; //max reached - waited x - seconds
    }

    return false;
}