How to mute the Audio?

Hi,
I want to mute the sound of only the one Gameobject my script is attached to.

I tried a lot of options to mute the sound, but it dies not work:
AudioSource audiosource;
audiosource = GetComponent();

// I tried these three, none of them works
if(…)
{
audiosource.mute = true;
AudioListener.volume = 0f;
audiosource.Stop();
}

Assuming your script and the audiosource are on the same object,

GetComponent<AudioSource>().volume = 0;

Should work.

if (Input.GetKeyDown(KeyCode.***))
{
audioSource.mute = !audioSource.mute;
}