how to set gameobject inactive then active after a few seconds in unity?

i have a collider: other that i am disabling through a OnTriggerEnter function and i would like to renable it after a few seconds, i have tried multiple methods such as coroutines or having a timer and none of them have been successful. For more information i have a player that picks up a coin when entering the coins trigger. I would like to renable it.

the ontrigger enter script:

 private void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.CompareTag("Collectable"))
        {
            other.gameObject.SetActive(false);
            count = count + 1;
            
            SetCountText();
        }
    }

HEllo, you said you tried corutines and didnt work, but corutines is your friend, corutines is what you need

private void OnTriggerEnter(Collider other)
 {
     if(other.gameObject.CompareTag("Collectable"))
     {
         StartCorutine(DisableAndEnable(other));
     }
 }

IEnumerator DisableAndEnable(Collider TheOtherCollider)
{
    TheOtherCollider.gameObject.SetActive(false);
    count = count + 1;
         
    SetCountText();
    yield return new WaitForSeconds (5);
    TheOtherCollider.gameObject.SetActive(true);
     
}

Bye!!