Check out example codes for "Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds". It will help you in understanding the concepts better.

Code Example 1

private IEnumerator OnTriggerStay(Collider other)
    {
        if (other.tag == "Player" && !_isDamaging)
        {
            _isDamaging = true;

            if (_playerHealth != null)
            {
                _playerHealth.Damage(10);
            }

            yield return new WaitForSeconds(1.5f);
            _isDamaging = false;
        }
    }

Learn ReactJs, React Native from akashmittal.com