How do I make my script trigger when colliding with a specific object

Here’s how to use code-tags when posting code.

Honestly, this is such a basic thing that it’s covered by pretty much every single Unity physics tutorial out there so asking on a forum seems odd. I would suggest watching some on Unity Learn or YouTube. If you’ve done that already then you should revisit them.

I will say though that you’re posting this on the 2D forum yet your code above is clearly using 3D physics. Rigidbody is 3D. Rigidbody2D is 2D. OnTriggerEnter is 3D. OnTriggerEnter2D is 2D. Again, all this is explained in all the basic tutorials out there.