Trying to get a key to play a sound when it is interacted with and disappears. Csharp

@Mavina
I’ll post the code below that I have already. The key was disappearing fine when it was in it’s most basic state and then as soon as i tried to add in the audio side of it it stopped disappearing when I interacted with it and worst of all the audio dosnt even play. I think what might be wrong is that the key isnt destroying itself because it’s waiting for the audio to play and finish but the audio isnt playing so it just sits there. Any help and insight would be greatly appreciated. Thank You !!

public class Key : MonoBehaviour
{
public new_door myDoor;
public AudioClip pickupSound;
public AudioSource audioSource;

public void Unlocknew_door()
{
	audioSource = GetComponent<AudioSource> ();
}
public void UnlockDoor() 
{
	myDoor.isLocked = false;
	audioSource.PlayOneShot(pickupSound);

	StartCoroutine("WaitForSelfDestruct");
}
IEnumerator WaitForSelfDestruct()
{
	yield return new WaitForSeconds(pickupSound.length);
	Destroy(gameObject);
}

}

@OptimisticSoundGuy
It is most likely that the GameObject is being destroyed before the sound can be played. I have restructured your code a little. Try this
using UnityEngine;
using System.Collections;

public class Key : MonoBehaviour
{
    public new_door myDoor;
    public AudioClip pickupSound;
    public AudioSource audioSource;

    void Start()
    {
        audioSource = GetComponent<AudioSource>();
        if (audioSource == null)
        { // if AudioSource is missing
            Debug.LogWarning("AudioSource component missing from this gameobject. Adding one.");
            // let's just add the AudioSource component dynamically
            audioSource = gameObject.AddComponent<AudioSource>();
        }
    }

    public void UnlockDoor() 
    {
        if (myDoor != null)
        {
            myDoor.isLocked = false;
        }
        StartCoroutine(WaitForSelfDestruct());
    }

    IEnumerator WaitForSelfDestruct()
    {
        audioSource.PlayOneShot(pickupSound);
        yield return new WaitForSeconds(pickupSound.length);
        StartCoroutine(DestroySelf());
    }

    IEnumerator DestroySelf()
    {
        yield return new WaitForSeconds(1.0f);
        Destroy(gameObject); // this should really be done in another object
    }
}

Spot on man, I know all this stuff might seem simple to you but honestly iv got no idea how you figure this stuff out :L Thank you !!