Play audio on Collision in Unity 2018.2 (GetComponent isnt working)

Hey so im trying to play a sound effect when my ball in the game hits something, but I cant figure out…
Audio.Play() doesnt work, so I went to unity 2018.2 Documentation but it also says GetComponent was removed in 2018.2.
Heres my code, it compiles fine but then nothing happens:

public class Ball : MonoBehaviour {

    AudioSource boing;

       private void OnCollisionEnter2D(Collision2D collision)
      {
           if(tag == ("Breakable")
           {
                boing = GetComponent<AudioSource>();
                boing.Play();
            }
      }    
}        

So, what should I do ?

you forgot the closing “)” around your if statement…
which meant its not compiling.

 public class Ball : MonoBehaviour {
 
     AudioSource boing;
 
        private void OnCollisionEnter2D(Collision2D collision)
       {
            // you forgot the last ')' which is why it didn't compile.
            if (tag == ("Breakable"))
            {
                 boing = GetComponent<AudioSource>();
                 boing.Play();
             }
       }    
 }