How to access collider2D outside the OntriggerEnter void?

I’m having some trouble with this collider:
when the player collides with a coin, it plays a sound and disabled the spriterenderer of the coin, but when the player dies and respawns, he can still collide with the “invisible” coin and plas the sound again.

So i was wondering, is there a way to access the “trig” collider from another void so i can respawn the coins, or a way to completely disable the coin after collided with the first time?

also, i tried to disable the audio source and to mute it, but then the sound does not play the first time.

void OnTriggerEnter2D(Collider2D trig) {

	if(trig.gameObject.name == "Coin"){

		trig.GetComponent<AudioSource>().PlayOneShot(sound, 1f);
		trig.GetComponent<SpriteRenderer>().enabled = false;

	}

}

What you’re doing right now is like pulling the white sheet of the ghost. You can’t see it anymore but that doesn’t mean it’s not there.

You can completely disable the coin using GameObject.SetActive (false). This will be equivalent to checking the toggle on the inspector for the gameobject. If you also plan on not using that gameobject (coin) anymore once it has been touched, you can also destroy it with the built in Destroy () function.

Examples:

    if (trig.gameObject.name == "Coin")
    {
             trig.GetComponent<AudioSource>().PlayOneShot(sound, 1f);
             trig.gameObject.SetActive (false);
    }
    
    //OR
    
    if (trig.gameObject.name == "Coin")
    {
             trig.GetComponent<AudioSource>().PlayOneShot(sound, 1f);
             Destroy (trig.gameObject);
    }

Thanks for your help @Guppy1337,

That fixed the disappearing problem but caused another: it prevented the audiosource (which was a component of “trig”, the coin, from playing the sound because it was disabled right after it started playing.

But this was fixed by simply attaching the audiosource to another gameobject.